Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PROBLEM Components lost and can't save new ones
#1
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 ?
Reply
#2
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));
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
(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. 
Reply
#4
Shawn_a hello buddy I inserted your command to check post and can see the array being outputted thus it cannot be blank.
Reply
#5
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 ?
Reply
#6
because these post vars are arrays not strings i suppose
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
(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 ?
Reply
#8
you can either change your code to a loop and check for strings only

or

get_filename_id() != 'components'
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)