Skip Navigation

[Assigned] Problem with a post form after migrating a site

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 16 replies, has 2 voices.

Last updated by lesleeM 1 year, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#2616011

We are in the process of finally launching our website. It is currently in maintenance mode because I've hit some snags after migrating the site from the development subdomain to the root domain. The situation causing me to submit this ticket looks like it has something to do with one of the post forms on our Ride template page.

You'll have to log in as an admin user to see the problem. Otherwise you'll only see the Maintenance page.

But after you log in, you'll want to go to this page:

hidden link

and to this page:

hidden link

This is the same ride and everything *should* still be set up the same way.

But for reasons unknown, we're getting the following errors on the production version of the site:

Warning: Creating default object from empty value in /home/customer/www/floridafreewheelers.com/public_html/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/models/Forms.php on line 187

Warning: Creating default object from empty value in /home/customer/www/floridafreewheelers.com/public_html/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/models/Forms.php on line 187

We have two post forms on the Ride template. If you scroll down to the bottom when logged in as an admin user, you should see links saying "Click here to Register for this Ride" and "Click here to Register for this Ride" Click both those links to expand the forms.

One thing I'm noticing that is different on the production version is there is a section above the Submit button on the Ride Notification form for Ride Notifications with a dropdown that says not set. This piece in the form is wrapped by the following

<div class="hidden-div">

</div>

On the development version of the same form, this section doesn't display. But on the production version, it does display. I didn't make any CSS changes, so I'm not sure what's causing the difference there.

Note that the form functionality does seem to be still working fine on the production site. I just tested that and my tests worked. So that's good.

So my questions here are:

1) How do we prevent the system from throwing those Warning messages?

and

2) How do we hide that section that shouldn't be displaying in the Notification form? Should I just add .hidden-div {display: none;} to the site CSS? We don't have that to my knowledge on the development site, but the section isn't displaying there. So I'd like to understand why that changed on the production site.

Thanks for your assistance here. This should be our final ticket before site launch. We could not have done this without your incredible support.

#2616031

Hello,

Please provide your website admin credentials in below private message box, I need to test and debug it in a live website, thanks

#2616307

Thanks for the details, I am checking it in your website, will update here if find anything

#2616313

I have done below modifications in your website:
Edit the post form "Ride Registration Form":
hidden link
in section "Form Editor", add line 18:

"label":""

It works fine in frontend:
hidden link
Please test again, check if it is fixed, thanks.

#2616335

OK, the warnings are now gone. That was the biggest thing so thanks for that. But we do not have that on the development.floridafreewheelers.com version of the same form. Any idea why that was needed here?

I went ahead and tried adding display: none; as styling for the wrapping div on the notification form and that worked to stop the display of that Ride Notification bit with the select field. We didn't want that to be visible.

I'm still unclear why these things happened due to migrating the site when nothing changed in the code. I won't argue with success in stopping the problem, but I wish I could understand what the cause was so I can hopefully avoid future repeats of this.

Please let me know if you have any idea why these changes had to be made on this version of the same page/forms. Thanks a bunch as always.

With those warnings gone, that's the last of the functionality problems I've seen on the production site. I just have about 65 pages/posts/rides to look at to check the remaining functionality on those pages and to make sure everything is responsively designed. Once I'm done with those 65 pages/posts/rides, the site gets taken out of maintenance mode and we are operational. I'm hoping to have it all done later today.

#2616339

It seems you have modified the generic field shortcode manually, you can simply add another generic checkbox field with UI, click button "Add generic field", it will setup the shortcode automatically, for example:

[cred_generic_field type='checkbox' field='Yes']
{
"required":1,
"default":"1",
"label":""
}
[/cred_generic_field]
#2616605

I'm completely confused now. I hadn't set up anything with this. I had the form set up in the visual editor, not expert mode. Something may have changed without my doing it with the site migration, but I'm not sure what that would be.

#2616883

It is required to setup the generic checkbox field with parameter "label", you just need to add it into the shortcode, or setup it using UI, click button "Add generic field".
Hope it is clear.

#2618113

I'm still not understanding this. I understand that you needed to add it to stop the error. But I don't understand why this wasn't producing the same error on the development site. When I expand the post form on the development site to expert, here's what's there for that bit.

[cred_generic_field type='checkbox' field='Yes']
{
"required":1,
"default":"1"
}
[/cred_generic_field]

But I wasn't getting the errors on that site. Only when I moved the site to the production domain did the errors start that required me to post this ticket. I was just hoping to understand that in case the reason would be something where I could prevent something similar requiring another ticket in the future.

#2618599

Now I'm seeing that there is another new problem with this registration form. Before I migrated the site from development to production, our Registration e-mail notifications were working fine. But now it is no longer including the ride title within the e-mail that gets sent to the ride leaders.

Our notification has the following:

[types field='name' item="%%POST_ID%%"][/types] has registered for your %%PARENT_POST_TITLE%% ride.

The e-mails I'm receiving now are as follows:

Rider Name has registered for your ride.

The Ride Title is not showing between "your" and "ride".

So the %%PARENT_POST_TITLE%% bit is broken now as well.

I didn't create a new ticket for this because I believe it's part of the same underlying problem that something broke with the post form when I migrated the site to the production URL. This was working perfectly before we migrated the site, just as I didn't have any of those error messages stemming from this form before we migrated the site as well.

#2618861

Difference serve environment can conduct problem, for example, if you use different PHP version in the product website and test site, to avoid such kind of problem, you will need to setup the shortcode with UI.

For the new issues, please point the problem user form URL, and where I can test the result in frontend.

#2618929

The odd thing is this is on the same server. The development site was on development.floridafreewheelers.com and the production site is on floridafreewheelers.com . The subdomain is in the same account as the root. I'm not sure what would have caused this behavior with the post form.

The form having these issues is the Ride Registration form on any of our Ride pages. Here is one where you can see it:

hidden link

Just click where it says "Click here to Register for this Ride" and that expands the form to appear. Let me know if you need admin access again.

We previously had it working perfectly to send the correct e-mail notification to Ride Leaders. But now it isn't working properly. The ride title is no longer appearing within the message.

I think this is the code you added previously:

<?php
/**
* Snippet to include Ride title in Ride Leader notifications about Registrations
*/

toolset_snippet_security_check() or die( 'Direct access is not allowed' );

// Put the code of your snippet below this comment.

add_filter('cred_subject_notification_codes', 'func_add_parent_post_title_to_email_notification', 10, 1);
add_filter('cred_body_notification_codes', 'func_add_parent_post_title_to_email_notification', 10, 1);
function func_add_parent_post_title_to_email_notification( $defaultPlaceHolders ) {
if( !isset( $_REQUEST['parent-post-title'] ) ) {
return $defaultPlaceHolders;
}
$newPlaceHolders = array(
'%%PARENT_POST_TITLE%%' => $_REQUEST['parent-post-title'],
);

return array_merge($defaultPlaceHolders, $newPlaceHolders );
}

#2618949

I have tried the credentials you provided above:
https://toolset.com/forums/topic/problem-with-a-post-form-after-migrating-a-site/#post-2616065
It is not valid any more, I get below error message:
Error: The password you entered for the username Toolset is incorrect.

Please check it, make sure it is valid admin account.

#2619535

Let me send you new credentials.

#2619541

Please provide the new credentials in below private message box, thanks