When using pressflow, boxes gives the error

Notice: Array to string conversion in boxes_footer() (line 155 of /ebs/platforms/sites/all/modules/boxes/boxes.module).

Looks like a similar issue/solution to http://drupal.org/node/601420

CommentFileSizeAuthor
#12 boxes.patch633 bytespenyaskito
#6 boxes-pressflow-headers.patch605 bytesrpfmorg
#1 887260.patch605 bytesteito79

Comments

teito79’s picture

StatusFileSize
new605 bytes

The problem is caused by a patched version of drupal_set_header when using Pressflow. I am not sure this patch belongs to boxes or to Pressflow patch set. What do you think?

we gave it a fix and here's the patch file

jmiccolis’s picture

Status: Active » Needs review

Well, if the pressflow version of `drupal_set_header()`returns an array... I actually like that better and have no problem adding this conditional.

@mzytaruk, does this patch work for you?

flevour’s picture

Version: 6.x-1.0-beta11 » 6.x-1.0

I applied this patch and the notice disappeared, I am using Pressflow myself too.
Cheers,
Francesco

mzytaruk’s picture

Yep, works perfectly for me as well. Thank you.

deverman’s picture

subscribing using pressflow and boxes but not sure if we have run into this yet.

rpfmorg’s picture

StatusFileSize
new605 bytes

I got a malformed patch error when applying this to version 6.x-1.0. The actual fix worked fine - I just needed to update the range information to get the patch to work.

jmiccolis’s picture

Status: Needs review » Fixed

Thx for the patch! It has been committed.

david strauss’s picture

While I appreciate the change to the module to make it compatible with Pressflow, this appears to be a bug in Pressflow's API, which should be as close to Drupal's as possible. Now, it's pretty easy for me to change the return value of the function back to the Drupal 6 way, but I'll have to survey the impact to other parts of Pressflow core. Can you file this as a bug on bugs.launchpad.net/pressflow? Thanks.

jmiccolis’s picture

Status: Fixed » Active

Reported https://bugs.launchpad.net/pressflow/+bug/652027

Opening the ticket back up; we'll need to revert this patch once there is a upstream release of Pressflow which includes a fix.

eojthebrave’s picture

I'm still getting this error with the latest release of boxes although #7 makes it sound like the patch was committed. Am I missing something?

The patch from #6 works great for me, but want to make sure that we're clear about the status of this so that other people don't get confused as well.

fuzzy76’s picture

eojthebrave, the patch is committed, but there have been no new releases of boxes for 6.x since then, so it is not part of any release yet.

For what it's worth, the original patch worked fine for me. :)

penyaskito’s picture

StatusFileSize
new633 bytes

I did another patch (my fault, I didn't look at the issue queue before).

It' s a different approach, so maybe it is worth taking a look.

It's a based on my own svn and the latest release of boxes. If you are intested on this approach I can make a patch against current HEAD in cvs.

Thanks.

Index: boxes.module
===================================================================
@@ -152,11 +152,9 @@
 function boxes_footer() {
   // Besure the page isn't a 404 or 403.
   $headers = drupal_set_header();
-  foreach (explode("\n", $headers) as $header) {
-    if ($header == "HTTP/1.1 404 Not Found" || $header == "HTTP/1.1 403 Forbidden") {
+  if ($headers[':status'] == "404 Not Found" || $headers[':status'] == "403 Forbidden") {
       return;
     }
-  }
 
   if (!empty($_GET['boxes_delta']) && boxes_access_admin()) {
     ctools_include('ajax');

Yura’s picture

#6 works well

j0nathan’s picture

Patch #6 works for OpenAtrium (profiles/openatrium/modules/contrib/boxes) over Pressflow.