Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Widget snippet] file (and file_list) field type looks like not working #93

Open
paolosax opened this issue Feb 27, 2019 · 7 comments
Open

Comments

@paolosax
Copy link

Hello,
I'm testing this widget class as I'd like to implement a custom widget that allow me to create an array of images to iterate in a customised slider.
I've noticed that, after the installation of this widget as it is, the "upload an image" button do not respond at all when clicking on it.

Any clue or suggestion about how to use this feature?

thx
Paolo

@tw2113
Copy link
Contributor

tw2113 commented Feb 27, 2019

Any sort of javascript errors or similar showing up in your browser's developer tools console?

@paolosax
Copy link
Author

paolosax commented Feb 27, 2019

Hello Michael, thanks for your quick reply...

...nope, but I've just noticed one thing (weird):

  • the upload button works in Chrome
  • it doesn't in Firefox (dev edition - the one I was working when I wrote this thread)
  • No js console errors in both

Now, after uploading an image with Chrome, it started to work Firefox too (???).

But, in both cases, the uploaded image do not appear in the theme template where I've included the dynamic_sidebar...

The same behaviour was for the Color Picker...

mmmh...

@tw2113
Copy link
Contributor

tw2113 commented Feb 27, 2019

It's this one that you're working with, right? https://github.com/CMB2/CMB2-Snippet-Library/blob/master/widgets/widget-example.php If not, please point to the one you are using.

It may be an example that needs refreshed/touched up, as I'm seeing it's 2 years old at this point, and if you've customized it since, then i'd just need to see what you have to try and offer any amount of support.

@paolosax
Copy link
Author

...yep, is this one with no personal customization. ANd I didn't noticed how "old" it was...
But right now I'm just testing for solutions in widget dev - and I'd like to leverage on CMB2 power...

@tw2113
Copy link
Contributor

tw2113 commented Feb 27, 2019

Noted.

One thing I'm seeing is that despite having an image field set up, the example code doesn't actually use that field at all in the widget output. So it's not so much that something is broken, it's just that it doesn't utilize every field provided in the output. Also since these are meant to be snippets and customized to one's needs, not the end of the world.

@paolosax
Copy link
Author

OK Michaeal, got it - very kind as usual...
...in fact I admit that I didn't thoroughly checked the whole code, as I thought that these was tested and working example snippets, to be considered as a starting point (I mean, I thought these was sort of "official" snippets lib coded & suggested by CMB2... but now I've just read the "Notes" section in the CMB2-Snippet-Library Read Me...)
;)

@tw2113
Copy link
Contributor

tw2113 commented Feb 27, 2019

It's in the weeds of nitpicky details, but in part it depends on what you define as "tested and working". For example the use, or lack of a use of a created field, in some widget output doesn't constitute that this isn't tested or not working in my mind. The primary purpose of the snippet is to show how to use CMB2 in a widget as a whole, which I believe it's doing still. If it was causing a fatal error that we could easily prevent with some guard statements or similar, then that would definitely be considered "not working" or "not tested extra thoroughly", and need updated/addressed.

On the flipside, I could also see some need to consider removing the non-used field as it's just adding what I'll call code noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants