The $data array is one iteration deeper than the logic is expecting. By changing the foreach loop i have managed to get it to work, however im new to Drupal and mysite so not sure if this is the best solution.

Patch attached.

CommentFileSizeAuthor
#3 mysite.module_3.patch479 bytesa_c_m
default.php_.patch603 bytesa_c_m
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

That $data array should be properly prepared before it gets to the layout stage, so this is likely not the right fix. If there is an error, it's in mysite_prepare_columns().

This issue (or a variant of it) keeps coming up. I think you have encountered an edge case, so more details about this error is needed. I can't test the patch until I can replicate the error.

- For what users (and roles) does this error occur?

- Whose mysite page are they looking at?

- What permissions do they have?

- What content exists in the mysite page?

- What page regions is that content assigned to?

A URL (and site access) or series of screenshots will be required.

Before continuing, check these dead issues:

http://drupal.org/node/168317
http://drupal.org/node/153570
http://drupal.org/node/157164

agentrickard’s picture

Status: Needs review » Needs work
a_c_m’s picture

Status: Needs work » Needs review
FileSize
479 bytes

Your questions :

- For what users (and roles) does this error occur?
Super user

- Whose mysite page are they looking at?
Their own

- What permissions do they have?
All

- What content exists in the mysite page?
2 droplets

- What page regions is that content assigned to?
One left, one right.

I dug a little further and to me the current code in mysite_prepare_columns() seems correct.

The problem as far as i see is that the $new array is expected to hold an array for each of the content areas, however the default.php expects to be given just an array of content direct, not an array within an array.

So the options seem to be :
In default.php tell it to select the first array element (which will be the 'main' content area) in the foreach.
or
In mysite.module you can add a else to the end of mysite_prepare_columns() to correctly format the array when $cols <= 1 (attached patch).

Or am i on totally the wrong track?

I am in #drupal if you want a more interactive discussion.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

Nope, you are absolutely correct.

I actually had this in earlier versions, but though the new array processing in mysite_prepare_columns() fixed it (see http://drupal.org/node/168317 for the history).

Obviously I was wrong.

It also appears that line 811 should be:

  if (count($data) == 1) {

Instead of the current:

  if (count($data) == 0) {

Which is a logic error on my part.

I don't have access to CVS right now, so no proper patch. This does need to get rolled and released, though.

And changing this in mysite_prepare_columns() means we don't need to update all the layout files. Though we might need to rethink the purpose of this function.

Thanks for the catch.

agentrickard’s picture

I will roll a 5.x.2.13 release tonight to fix this error.

Thanks again/

a_c_m’s picture

Glad to be of help.

I sent you a message via the contact form on your profile - which i hope got to you.

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD and released in 5.x.2.13

Anonymous’s picture

Status: Fixed » Closed (fixed)