GetSimple Support Forum
PROBLEM Components lost and can't save new ones - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: PROBLEM Components lost and can't save new ones (/showthread.php?tid=8845)



Components lost and can't save new ones - vish93 - 2016-11-14

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 ?


RE: Components lost and can't save new ones - shawn_a - 2016-11-15

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));


RE: Components lost and can't save new ones - vish93 - 2016-11-15

(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. 


RE: Components lost and can't save new ones - vish93 - 2016-11-15

Shawn_a hello buddy I inserted your command to check post and can see the array being outputted thus it cannot be blank.


RE: Components lost and can't save new ones - vish93 - 2016-11-15

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 ?


RE: Components lost and can't save new ones - shawn_a - 2016-11-15

because these post vars are arrays not strings i suppose


RE: Components lost and can't save new ones - vish93 - 2016-11-15

(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 ?


RE: Components lost and can't save new ones - shawn_a - 2016-11-15

you can either change your code to a loop and check for strings only

or

get_filename_id() != 'components'