Skip to content

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

Open

Description

@paolosax

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

Activity

  1. tw2113 commented on Feb 27, 2019

    @tw2113
    Contributor

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

  2. paolosax commented on Feb 27, 2019

    @paolosax
    Author

    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...

  3. tw2113 commented on Feb 27, 2019

    @tw2113
    Contributor

    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.

  4. paolosax commented on Feb 27, 2019

    @paolosax
    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...

  5. tw2113 commented on Feb 27, 2019

    @tw2113
    Contributor

    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.

  6. paolosax commented on Feb 27, 2019

    @paolosax
    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...)
    ;)

  7. tw2113 commented on Feb 27, 2019

    @tw2113
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions