- This topic has 8 replies, 3 voices, and was last updated 4 years, 5 months ago by Tom.
September 14, 2015 at 9:53 pm #136813Kat
Hope you may be able to advise what this error message means – this has appeared on the home page after moving the website from the test directory to the public_html folder:
Warning: Invalid argument supplied for foreach() in /home/diamondp/public_html/wp-content/plugins/gp-premium/addons/generate-sections/functions/generate-sections.php on line 151
KitkaSeptember 15, 2015 at 12:08 am #136843TomLead DeveloperLead Developer
What version of GP Premium are you using?
How did you migrate the site to the new directory? I suggest giving the Duplicator plugin a try – it moves everything over seamlessly and should stop weird errors like this from happening.
Let me know 🙂September 15, 2015 at 12:38 am #136850Kat
Thanks. The GP version is Version: 1.3.13
I placed a copy of all WordPress files in the public_html folder, copied the wp-content folder over and made a copy of the database but did a find-and-replace to edit out the path to the test directory. I have moved dozens of WordPress sites in this way.
KitkaSeptember 15, 2015 at 12:41 am #136851TomLead DeveloperLead Developer
Doing a copy and paste in the DB can work but can also cause issues (I’ve dealt with them first hand).
Can you try using Duplicator so we can see if it was the migration process that caused the issue?
Basically that error is saying there should be sections but it can’t find any in the DB.September 15, 2015 at 12:49 am #136853Kat
Is this the plugin you refer to?
KitkaSeptember 15, 2015 at 10:02 am #136985TomLead DeveloperLead DeveloperSeptember 19, 2016 at 4:19 am #227643Elizalde
This is very unfortunate for me because I am not able to execute the duplicator plugin because it always say “error in processing”. It has an issue in Godaddy. I have been trying to backup my site and tried to restore it to a localhost linux server and to another Godaddy account but unfortunately, the sections are broken and I am seeing a message saying “Warning: Invalid argument supplied for foreach() in /home/XXXXX/public_html/XXXXX/wp-content/plugins/gp-premium/sections/functions/generate-sections.php on line 197”. I have tried using the method of Kitka and as what she said, I’ve also tried this method a lot of times already and it always work. Duplicator has issues in Godaddy and now I’m paranoid about not having a working backup.
Thanks in advance!September 19, 2016 at 4:25 am #227644Elizalde
I’ve also got this another warning message in the same page i’ve posted above. “Warning: Invalid argument supplied for foreach() in /home/XXXXX/public_html/XXXXX/wp-content/plugins/gp-premium/sections/functions/templates/template.php on line 40”
Hoping you could help me sort this out.September 19, 2016 at 8:54 am #227721TomLead DeveloperLead Developer
Sections are saved as a serialized table in the database. When people do a search/replace for their URL in the database, it breaks serialized tables (not just Sections, but any serialized tables).
That’s why plugins like BackupBuddy, Duplicator, Updraft Plus etc.. are so useful, as they take care of issues like this for you.
Those warnings are happening because the page thinks it should have sections, but those sections no longer exist in the database, most likely due to search and replacing of URLs.
- You must be logged in to reply to this topic.