GetSimple Support Forum

Full Version: Components lost and can't save new ones
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys I updated my GMS to 3.3.13 from 3.3.12. Now, when I go to edit my components they have all disappeared and cannot even add new ones. When I create one and save, it says it has been saved but I cannot see it.

What is going on ?

Update:

It looks to occur when I make a change and press save. I went to /data/other/components.xml and it shows empty. Replaced this file with one from back up I had and the components are back. But I cannot make changes as this removes them weirdly.

What could be happening here ?


Update 2:

Doing some digging I see in the error log:

PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/gms/admin/components.php on line 46
PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/gms/admin/components.php on line 66

foreach ($ids as $id) and foreach ($ids as $comp) are the two respective arguments. Is this a bug ?
no bug, there was only 1 change between those versions, i suspect something else is going on.

What browser ?

Sounds like something is getting stripped from your post maybe you have a browser issue or a js error also ?

stick a die in there to debug your post fields , sounds like ids is empty.

component.php
die(print_r($_POST));
(2016-11-15, 00:55:36)shawn_a Wrote: [ -> ]no bug, there was only 1 change between those versions, i suspect something else is going on.

What browser ?

Sounds like something is getting stripped from your post maybe you have a browser issue or a js error also ?

stick a die in there to debug your post fields , sounds like ids is empty.

component.php
die(print_r($_POST));

Browser is chrome.

Hmmm... I'll give that a go now. 
Shawn_a hello buddy I inserted your command to check post and can see the array being outputted thus it cannot be blank.
shawn_a sorry buddy in my custom plugin I have the line:

Code:
$_POST= array_map('htmlspecialchars', $_POST);

commenting this made the components work. Any idea why this could have been affecting it ?
because these post vars are arrays not strings i suppose
(2016-11-15, 01:47:21)shawn_a Wrote: [ -> ]because these post vars are arrays not strings i suppose

Would there be a way to make it ignore this command in components page ?
you can either change your code to a loop and check for strings only

or

get_filename_id() != 'components'