Creating custom tabs module - issue with field type 'multiple-photos'

Hi there,

I’m creating a custom tabs module for one of my clients sites. Basically the module allows the display of several different event spaces that the client has to offer.

I need each tab to show 1 main image, some text content, offer a floor plan download and then store a small number of photos as a gallery which visitors can view. I’m able to do eveything but the gallery. I’ve used the field type multiple-photos but I’m getting the following error (using Chrome). I’m assuming I’ve just missed out a file which the multiple photos functionality relies on. Would you be able to point me in the right direction? I’ve tried to debug using the main Gallery module but have not succeeded yet!

WP and FTP access can of course be provided if required.

Thanks in advance for your help.

Best,
Dan

Sorry forgot to provide the error message! Please find below:


fl-builder.js?ver=1.5.9:4873 Beaver Builder caught the following JavaScript error. If Beaver Builder is not functioning as expected the cause is most likely this error. Please help us by disabling all plugins and testing Beaver Builder while reactivating each to determine if the issue is related to a third party plugin.
fl-builder.js?ver=1.5.9:4873 “Uncaught TypeError: JSON.parse(…).join is not a function” on line 4038 of http://glenmore.local/wp-content/plugins/bb-plugin/js/fl-builder.js?ver=1.5.9.
fl-builder.js?ver=1.5.9:4873 TypeError: JSON.parse(…).join is not a function
at HTMLAnchorElement.FLBuilder._selectMultiplePhotos (fl-builder.js?ver=1.5.9:4038)
at HTMLBodyElement.m.event.dispatch (jquery.js?ver=1.11.2:3)
at HTMLBodyElement.m.event.add.r.handle (jquery.js?ver=1.11.2:3)
fl-builder.js?ver=1.5.9:4873 ************************************************************************

Hi Dan,

You shouldn’t need to include anything special for the multiple photos field. Can you shoot me temporary WP and FTP access to test?

Thanks,
Justin

[Content Hidden]

Thanks, Dan. I’m checking this out now.

Justin

Cheers Justin, look forward to hearing back from you soon. Apologies in advance for some of the rough coding there. I’ve only recently started creating my own modules and still learning off the modules you guys provide!

Best,
Dan

Hey Dan,

You’re all set! It seems you stumbled across a tricky bug that came about because you were using the multiple-photos field within a multiple field. Apparently you are the first one to do that because I was able to recreate the issue immediately (and have never seen it before). I’ve patched your site and will include the fix in the the next release.

Let me know if you have any questions.

Justin

Hi Justin,

Thanks so much for doing that - lifesaver! I think I hit that same issue before when I was trying to put a form within a form. Will I now be able to do that as well? Just so I know what to move (I’m using BackupBuddy to deploy changes now between local and live so don’t want to overwrite your changes) could you let me know what files you’ve changed? Is it just the BBuilder plugin folder or is it within my custom modules?

Best,
Dan

You’re welcome, Dan!

think I hit that same issue before when I was trying to put a form within a form. Will I now be able to do that as well?

Do you mean this… Main Form > Sub Form > Sub Form

or just this… Main Form > Sub Form > Sub Form

You should be able to do a single sub form, but we don’t currently support doing a third level.

Is it just the BBuilder plugin folder or is it within my custom modules?

The only file that was changed was plugins/bb-plugin/includes/field-multiple-photos.php.

Justin

Hi Justin,

Great, thanks for confirming. Yes that’s what I mean. Click on the module, then on a sub form and then have a another form within that sub form. That’s fine - totally understand it starts getting a bit complex. Out of interest do you think this will ever be added?

I only ask as I was recently doing another events orientated website (seems to be my thing for 2015 :D) and the client wanted a tab for each of their locations and then within that another tab where you could browse through the spaces they had to offer with a bit of information for each of these spaces. In the end I just went with separate page but they seemed to have a thing about tabs!

Thanks again for such a great plugin. I’ll make sure I leave a review when I get some downtime.

Cheers,
Dan

Hi Dan,

That’s a great question. Honestly, we’ve never considered it and it’s a bit complex, so the answer is most likely no, but it’s not out of the realm of possibilities. If you want, you can add the idea to our UserVoice forum so we have a record of it.

I’m glad to hear you’re liking the plugin!

Justin

Hi,

I came across this article because I apparently encounter the same error. Have you added the fix since your last message?

'background'  => array(
                'title'         => __( 'Background', 'e-maker' ),
                'fields'        => array(
                    'h1_background_color'     => array(
                        'type'          => 'video',
                        'label'         => __( 'Background video', 'e-maker' ),
                    ),
                    'h1_background_image'     => array(
                        'type'          => 'multiple-photos',
                        'label'         => __( 'Background image', 'e-maker' ),
                    )
                )
            ),

Thanks

Hi Sylvain,

Can you describe what issue you are referring to? We discussed a few things in this thread.

Thanks!
Justin

Ok, sorry.

I’m trying to use field ‘multiple-photos’ in a custom module.
In the builder i can’t click on “add photo” or “edit"gallery”. I have this error :

« Uncaught TypeError: JSON.parse(...).join is not a function » à la ligne 4 de http://my.domain.me/wp-content/plugins/bb-plugin/js/fl-builder.min.js?ver=1.7.6.
fl-builder.min.js?ver=1.7.6:4 TypeError: JSON.parse(...).join is not a function
    at HTMLAnchorElement.FLBuilder._selectMultiplePhotos (fl-builder.min.js?ver=1.7.6:4)
    at HTMLBodyElement.m.event.dispatch (jquery.js,qver=1.11.3.pagespeed.jm.zixJPNMRNN.js:1)
    at HTMLBodyElement.r.handle (jquery.js,qver=1.11.3.pagespeed.jm.zixJPNMRNN.js:1)
fl-builder.min.js?ver=1.7.6:4 ************************************************************************

Thanks, Sylvain. Have you tried disabling other plugins to see if there is a conflict somewhere? Other than that, would you mind sending me a copy of your module to test?

Justin