Skip Navigation

[Resolved] Upgrading PHP without breaking my site

This support ticket is created 5 years, 6 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 10 replies, has 2 voices.

Last updated by Shane 5 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#1283431

Hello,

I am currently running PHP 5.4.45 on my site, but WordPress is telling me that I need at least 5.6.20 or higher to run WordPress release 5.2.2. I remember having tried PHP 7 offline and it had done some weird things to CPT relationships.

Should I have any problem with my Toolset built site if I upgrade to PHP 7

Thank you

#1283483

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Arrien,

Thank you for contacting our support forum.

It actually recommended to update to php version 7. I know our toolset plugin is compatible with this version but I cannot say the same for the other plugins that you may have installed.

So I would recommend doing this in a testing environment first.

Thanks,
Shane

#1283487

My issue is resolved now. Thank you!

#1283503

Hello,

I just duplicated my site to a local server to test PHP 7. The site breaks when trying to use forms to create new post types.

#1283515

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Arrien,

Have you updated the toolset plugins to their latest versions ?

Could you let me know which versions of our plugins you are using ?

Thanks,
Shane

#1283551

Hi Shane,

I have updated all the plug-ins and still get an error:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function item_title(), 1 passed in C:\xampp\htdocs\cuccr_s2019\wp-includes\class-wp-hook.php on line 288 and exactly 2 expected in C:\xampp\htdocs\cuccr_s2019\wp-content\plugins\check-in_check-out.php\check-in_check-out.php:9 Stack trace: #0 C:\xampp\htdocs\cuccr_s2019\wp-includes\class-wp-hook.php(288): item_title(16988) #1 C:\xampp\htdocs\cuccr_s2019\wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #2 C:\xampp\htdocs\cuccr_s2019\wp-includes\plugin.php(465): WP_Hook->do_action(Array) #3 C:\xampp\htdocs\cuccr_s2019\wp-content\plugins\cred-frontend-editor\application\models\form\post.php(636): do_action('cred_save_data', 16988, Array) #4 C:\xampp\htdocs\cuccr_s2019\wp-content\plugins\cred-frontend-editor\application\models\form\base.php(441): CRED_Form_Post->save_form(16988) #5 C:\xampp\htdocs\cuccr_s2019\wp-content\plugins\cred-frontend-editor\application\controllers\form_builder_base.php(40): CRED_Form_Base->print_form() #6 C:\xampp\htdoc in C:\xampp\htdocs\cuccr_s2019\wp-content\plugins\check-in_check-out.php\check-in_check-out.php on line 9

#1284095

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Arrien,

Would you mind providing me with a copy of the site so that I can test it out here locally as well ?

To do this please follow the instructions in the link below.
https://toolset.com/faq/provide-supporters-copy-site/

Thanks,
Shane

#1284279

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Arrien,

You need to disable these plugins as well as I know the CRED is compatible with php 7.

If you are still experiencing this issue please let me know.

I've tested out your duplicator package on my local server running a version of PHP 7 and it works flawlessly even with the plugins enabled.

Could you also let me know the scenario under which the site throws this error.

Thanks,
Shane

#1284305

Hi Shane,

The scenario is when browsing to localhost/your_folder_name/membership/

Fill out the form information

Then checking the Membership custom post type on the backend the title comes up as CRED Auto Draft...

When you fill out the form at localhost/your_folder_name/membership/ what do the Member titles save as?

Thanks

#1284317

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Arrien,

The reason why you are getting this, is because of your custom code.


add_action('cred_save_data','item_title',10,2);
function item_title($post_id, $form_data) {
            $type = get_post_type($post_id);
            if ($type == 'material-check-out')  {
                         
                        $parent_id = $_POST["_wpcf_belongs_member_id"];
                        $title = get_the_title($parent_id);
                        $slug = sanitize_title($title);
                        wp_update_post(array('ID' => $post_id, 'post_title' => $title, 'post_status'   => 'publish'));
            }
    
            if ($type == 'material-check-in')  {
                         
                        $parent_id = $_POST["_wpcf_belongs_member_id"];
                        $title = get_the_title($parent_id);
                        $slug = sanitize_title($title);
                        wp_update_post(array('ID' => $post_id, 'post_title' => $title, 'post_status'   => 'publish'));
            }
}

It seems that there is an issue with the code itself. I solved the issue by adding this line add_action('cred_save_data','item_title',10,2);

This should now be working.

Thanks,
Shane

#1284323

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Status change