Hi,

My hosting provider recently rolled out new servers using PHP 5.4.11

My other sites with them utilize PHP 5.2.17

I'm seeing errors on the newer server related to Sweaver. It's configured the same, and is the same version as I've used on the older sites, so the version of PHP is the only difference I can think of.

Here's what I'm seeing:

Notice: Array to string conversion in sweaver_plugin_advanced->sweaver_form() (line 59 of /home/boundle2/public_html/sites/all/modules/sweaver/plugins/sweaver_plugin_advanced/sweaver_plugin_advanced.inc).
Warning: Invalid argument supplied for foreach() in element_children() (line 6400 of /home/boundle2/public_html/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5867 of /home/boundle2/public_html/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5877 of /home/boundle2/public_html/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5915 of /home/boundle2/public_html/includes/common.inc).
Warning: Illegal string offset '#printed' in drupal_render() (line 5922 of /home/boundle2/public_html/includes/common.inc).

If I disable the advanced plugin, the error does go away, but unfortunately, I definitely need the advanced capabilities of the modules.

Any ideas?

Thanks, in advance, for taking a look for for your work on this module. I LOVE IT!

Files: 
CommentFileSizeAuthor
#4 new-error-messages-fix-1968026-3.patch820 bytesdagomar
Test request sent.
[ View ]

Comments

flachica’s picture

I've seen this exception happens when you install a module that depends on a third party to operate, particularly when installing Grammar Library. I made the installation of dependent modules one by one and the problem no longer come back to me.

play4quarters’s picture

Thanks flachica.

I will definitely circle back, don't see any new modules I've not integrated before, other than bean.

For now, I've disabled sweaver. Once I'm completed with the project, I'll make a copy and see if it's a module conflict so it may be of assistance to others.

Thanks much.

dagomar’s picture

Quick fix for this, change:

<?php
$form
['#editor_containers']['three']['content'][] = array('#markup' => t('Use the current style on')) . ' : ';
?>

to

<?php
$form
['#editor_containers']['three']['content'][] = array('#markup' => t('Use the current style on') . ' : ');
?>

This SHOULD be made into a patch but I haven't time now. Note that the error message is relevant, the code tries to append a string to an array, which is impossible.

dagomar’s picture

Status:Active» Needs review
StatusFileSize
new820 bytes
Test request sent.
[ View ]

Here's a patch.

alibama’s picture

Thank you dagomar - this fixed the error messages on my site - I'm running a bitnami stack (ubuntu based) for drupal 7

skessler’s picture

Why was the patch not tested? Is this something to be concerned about?

play4quarters’s picture

Thanks dagomar. This correction also worked for me. Much appreciated

dagomar’s picture

Status:Needs review» Active

I don't understand why it wasn't tested, when I looked right after I posted the patch it gave some sort of warning about the sweaver module on the test site, but now it only says 'postponed'. Maybe I can change the status and it will try to test again?

dagomar’s picture

Status:Active» Needs review

Try to test the patch again...

dagomar’s picture

Ok, sorry I found what I think is going wrong. The sweaver module has errors in the test, thats why the patch cannot be tested. See here:

https://qa.drupal.org/pifr/test/270793

I'll create a new issue for this shall I?

joelpittet’s picture

Status:Needs review» Reviewed & tested by the community

This patch is correct, so I'm RTBCing it;)

alibama’s picture

rtbc +1