Skip Navigation

[Resolved] There are 2 +Add New buttons displayed on my form

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a Form that includes a custom taxonomy input field along with the option to add a new term, "+ Add New". After updating to the new drag-and-drop Form builder and moving the field around, there are two "+ Add New" buttons next to the term input field.

Solution: Update to Forms 2.3.2 to receive the fix for this issue. After updating please find and edit the Form in wp-admin. Delete the taxonomy field, then use the drag-and-drop editor to replace the field in the Form body.

Relevant Documentation: https://toolset.com/errata/add-new-shortcode-for-taxonomy-term-in-forms-is-duplicated-or-not-shown-at-all/

This support ticket is created 5 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 15 replies, has 2 voices.

Last updated by marcelO-2 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1207643
Performer Submission Form   Magic Africa.png

I am trying to: Have +Add New button on my form

Link to a page where the issue can be seen: hidden link

I expected to see: +Add New button

Instead, I got: 2 +Add New buttons

#1207970

Hard to tell what's going on here with multiple JS errors in the console:

Uncaught SyntaxError: missing ) after argument list
(index):80 Uncaught ReferenceError: _ is not defined
    at (index):80
(index):94 Uncaught ReferenceError: wp is not defined
    at (index):94
    at (index):97
(index):113 Uncaught ReferenceError: jQuery is not defined
    at (index):113
(index):984 Uncaught ReferenceError: jQuery is not defined
    at (index):984
(index):1028 Uncaught ReferenceError: jQuery is not defined
    at (index):1028
(index):1189 Uncaught TypeError: Cannot read property 'editor' of undefined
    at (index):1189
(index):1279 Uncaught ReferenceError: tinymce is not defined
    at (index):1279
(index):1386 Uncaught ReferenceError: wptValidationForms is not defined
    at (index):1386
b9a7509b-8e9c-48f1-8f62-b87e40f82743.js:2 Uncaught TypeError: Cannot read property 'flowRight' of undefined
    at Module.309 (b9a7509b-8e9c-48f1-8f62-b87e40f82743.js:2)
    at r (b9a7509b-8e9c-48f1-8f62-b87e40f82743.js:2)
    at wp.data.0 (b9a7509b-8e9c-48f1-8f62-b87e40f82743.js:2)
    at b9a7509b-8e9c-48f1-8f62-b87e40f82743.js:2
539c65f4-0b20-48c0-ac90-428edd288a65.js:2 Uncaught TypeError: Cannot read property 'extend' of undefined
    at Module.298 (539c65f4-0b20-48c0-ac90-428edd288a65.js:2)
    at n (539c65f4-0b20-48c0-ac90-428edd288a65.js:2)
    at wp.shortcode.2 (539c65f4-0b20-48c0-ac90-428edd288a65.js:2)
    at 539c65f4-0b20-48c0-ac90-428edd288a65.js:2
2587f8e8-253a-4a87-b9b3-8be1922176e2.js:3 Uncaught TypeError: Cannot read property 'combineReducers' of undefined
    at Module.308 (2587f8e8-253a-4a87-b9b3-8be1922176e2.js:3)
    at r (2587f8e8-253a-4a87-b9b3-8be1922176e2.js:2)
    at wp.blocks.0 (2587f8e8-253a-4a87-b9b3-8be1922176e2.js:2)
    at 2587f8e8-253a-4a87-b9b3-8be1922176e2.js:2
1c8e601f-1855-47b9-985d-5a8a6dd55d71.js:3 JQMIGRATE: Migrate is installed, version 1.4.1

Those need to be resolved before I can really dig in. Can you activate a default theme like Twenty Nineteen, deactivate all other plugins, and test again? If the problem is resolved, reactivate your theme and other plugins one by one until you see errors appear in the browser console again. Let me know what you find out and we can go from there.

#1208205

It was custom JS script I was using on the Form.

(which isn't working anyway)

Have removed all custom JS script, please try again?

#1209117

There is still a JavaScript error in the console:

bb8c0fd8-3de3-48e5-9777-c588cb7a063b.js:formatted:98 Uncaught TypeError: Cannot read property 'dataset' of null
    at bb8c0fd8-3de3-48e5-9777-c588cb7a063b.js:formatted:98
    at bb8c0fd8-3de3-48e5-9777-c588cb7a063b.js:formatted:105
(anonymous) @ bb8c0fd8-3de3-48e5-9777-c588cb7a063b.js:formatted:98
(anonymous) @ bb8c0fd8-3de3-48e5-9777-c588cb7a063b.js:formatted:105

There is also a 403 error when attempting to load this theme JS file:
hidden link

After a deeper investigation, I can see that this is a non-standard file delivery system because the JavaScript filenames have been manipulated. We recommend you do not use optimization plugins or systems to reorganize, repack, minify, or otherwise manipulate Toolset's JavaScript and CSS assets. It looks like that's happening on this site, because JavaScript files aren't being loaded from the standard locations in wp-content/plugins/**. Instead, I see a WPMU CDN domain and JavaScript filenames that do not correspond to the filenames included in our codebase. I'm not sure if this is a server-side implementation (like an asset delivery optimization system) or a client-side implementation (like trying to import Toolset's files into a custom application using webpack or another JavaScript modular system). Either way, Toolset isn't designed to work with this type of manipulation. Can you exclude Toolset plugins? If so, please allow Toolset plugins to load normally outside of this optimization or minification layer.

#1209396

Thank you, I think I have disabled the optimisations.

Could you look again?

#1209568

There's still a JavaScript error in the console. May I log in and see how you have this set up in wp-admin? If necessary, I would like to create a clone of your site using the Duplicator plugin.

#1209724

Hmm, okay I after a bit more investigation I see what's happening more clearly and I am able to replicate this problem on my local environment. It seems to be a problem with the "Add New" shortcode being inserted in the Form twice somehow by the new Form builder system. If I switch in my local environment to Expert mode in the Form builder, I can delete the duplicate shortcodes and resave the Forms. Then the "Add new" buttons appear as expected. However, if I try to switch back to drag-and-drop mode the problem returns in some cases. I am escalating this to my 2nd tier support team for more investigation, because it seems like a bug. I will let you know what I find out, or if I hear of a better workaround.

#1210043

Our development team is addressing this issue as a bug in the current software and I will keep you updated here as work progresses.

#1211452
Screen Shot 2019-03-07 at 11.24.21 AM.png

Quick note about this. The problem seems to be specific to the dragging feature. You may be able to work around this until the fix is ready. Delete the field from the Form, then replace it by clicking the icon instead (see screenshot). When the field appears in the builder, twirl it open and select the options you want and save the Form. If you drag the field around in the builder, the problem may return. Instead, drag other fields around this field to modify the Form layout.

#1211796

Christian, looks like the work-around doesn't actually work.

Will await the update.

#1212641

I see, thanks for the information. It could be that the workaround depends on a specific setup that is different for your form. At any rate, the permanent fix is in QA now, and our developers have provided a beta version if you'd like to try it out sooner than the final update. Let me know if you would like to try that out, or if you would prefer to wait until the QA-tested version is ready to download.

#1218048

Hi, our team has released updates for Forms and Views today. You can find those updates now at https://toolset.com/account/downloads, or they will be available for automatic update later today. Please update to the latest versions of Toolset plugins and test again. Let me know if the problem is not resolved.

#1218932

Recent update has not made any difference, there are still 2 x Add New buttons on hidden link

#1219213

I apologize, I didn't realize the field would have to be recreated. My instructions for you were incomplete. I removed the Performance Styles input field from the Form, then replaced it and saved the Form. It seems to be appearing as expected now, can you confirm?

#1219578

Thank you.

To fix the original problem, as you've said, you've got to delete one of the fields and recreate it.

Interestingly, if multiple fields have the 2 + Add New buttons' problem, by just recreating any one of the fields, it fixes all of the Add New problems.

Issue resolved!