- This topic has 8 replies, 3 voices, and was last updated 7 years, 7 months ago by Tom.
-
AuthorPosts
-
September 14, 2015 at 9:53 pm #136813Kat
Hello
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
Thanks
KitkaSeptember 15, 2015 at 12:08 am #136843TomLead DeveloperLead DeveloperHi there,
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 #136850KatThanks. 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.
Kitka
September 15, 2015 at 12:41 am #136851TomLead DeveloperLead DeveloperDoing 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 #136853KatSeptember 15, 2015 at 10:02 am #136985TomLead DeveloperLead DeveloperThat’s the one! It may be worth trying just to see if it was the migration process that caused the issue.
Let me know ๐
September 19, 2016 at 4:19 am #227643ElizaldeHi Tom,
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 #227644ElizaldeI’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 DeveloperSections 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.
-
AuthorPosts
- You must be logged in to reply to this topic.