0 users online. Create an account or sign in to join them.Users

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#295: Log warnings caused by page editor

The page editor in content.blueprintspages.php causes lots of PHP warnings in the log because of empty arrays etc. if no events or datasources are attached to the page:

2010/04/04 00:35:08 > WARNING: 2 - in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in file /var/www/www.example.com/symphony/content/content.blueprintspages.php on line 579
2010/04/04 00:35:08 > WARNING: 2 - in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in file /var/www/www.example.com/symphony/content/content.blueprintspages.php on line 579
2010/04/04 00:35:08 > WARNING: 2 - in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in file /var/www/www.example.com/symphony/content/content.blueprintspages.php on line 579
... (and more)
2010/04/04 00:35:08 > WARNING: 2 - in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in file /var/www/www.example.com/symphony/content/content.blueprintspages.php on line 597
2010/04/04 00:35:08 > WARNING: 2 - in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in file /var/www/www.example.com/symphony/content/content.blueprintspages.php on line 597
2010/04/04 00:35:08 > WARNING: 2 - in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in file /var/www/www.example.com/symphony/content/content.blueprintspages.php on line 597
... (and more)
2010/04/04 00:35:14 > WARNING: 2 - implode() [<a href='function.implode'>function.implode</a>]: Bad arguments. in file /var/www/www.example.com/symphony/content/content.blueprintspages.php on line 748
2010/04/04 00:35:14 > WARNING: 2 - implode() [<a href='function.implode'>function.implode</a>]: Bad arguments. in file /var/www/www.example.com/symphony/content/content.blueprintspages.php on line 749

As you see in content.blueprintspages.php, some of the warnings have to do with events, some with datasources. Both use the same logic (and both will have empty fields[...] arrays if none is selected). So if you attach an event or a datasource, many warnings will go away. If you attach both, there will be no warning.

Our goal for Symphony 2.0.8 is a log w/o warnings or errors, isn’t it?

This issue may be classified “2.0.7+” (but may be even older).

The first type of warnings disappeared (probably related to #294’s proposed solution).

The second type of warnings (referring to lines 748 and 749 in content.blueprintspages.php) might be solved by checking for arrays in these lines, maybe like so:

$fields['data_sources'] = $fields['data_sources'] ? @implode(',', $fields['data_sources']) : NULL;          
$fields['events'] = $fields['events'] ? @implode(',', $fields['events']) : NULL;

The second type of warnings (referring to lines 748 and 749 in content.blueprintspages.php) might be solved by checking for arrays in these lines, maybe like so:

This was fixed. See this commit.

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details