(2.0.7) Saving preferences results in an error
A for , submitted by Nils on 05 January 2010
Announcement
Symphony's issue tracker has been moved to Github.
Issues are displayed here for reference only and cannot be created or edited.
Browse
Closed#200: (2.0.7) Saving preferences results in an error
Nils, I might be totally off topic here, so excuse me in advance.
I had a similar problem when I was trying to make your extension - the Localisation Manager - compatible with the 2.0.7 release. The answer lies in supplying HTML form inputs with a legal value for the name attribute. For example, in extension.driver.php
at line 219
there was:
$select = Widget::Select('settings[language]', $options);
By the way, when trying to save the new settings I received the same exact error that you reported above. I’ve found a working solution by replacing the old line with:
$select = Widget::Select('settings[symphony][lang]', $options);
This way, the expected requirements for the settings
array (i.e. to be bidimensional) are met and foreach
s don’t throw any runtime error. Plus, language settings are correctly saved inside the config.php
file under the symphony
section.
Again, sorry if that was not your case…
Thanks, that’s exactly the case. I’ve a working version of the Localisation Manager locally but I still have to adjust it to accept subfolders in the lang directory. And I still think that anything besides the translation file generation should be integrated into the core.
Hopefully this commit has fixed the problem. It will prevent that Foreach loop from running if the $settings
variable is empty or not an array.
This issue is closed.
Invalid argument supplied for foreach()
An error occurred in /www/htdocs/webseiten/hananils/symphony/content/content.systempreferences.php around line 65
Backtrace
[/www/htdocs/webseiten/hananils/symphony/content/content.systempreferences.php:65] GenericErrorHandler::handler(); [/www/htdocs/webseiten/hananils/symphony/lib/toolkit/class.administrationpage.php:70] contentSystemPreferences->action(); [/www/htdocs/webseiten/hananils/symphony/lib/core/class.administration.php:88] AdministrationPage->build(); [/www/htdocs/webseiten/hananils/symphony/lib/core/class.administration.php:204] Administration->__buildPage(); [/www/htdocs/webseiten/hananils/index.php:20] Administration->display();