Add content pop up not looking good and giving PHP warnings.

Vidar Løvbrekke... - June 23, 2008 - 22:18
Project:Panels
Version:5.x-2.0-beta5
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

After upgrading to BETA5 from BETA4 the Add content pop up shows all the options in just one column and css styling is not what it used to be (screenshot 1)

Allso after choosing an element to add I get two kinds of php warnings:
warning: Wrong parameter count for range() in *path_to_drupal_site_dir*/modules/panels/includes/display_edit.inc on line 798.
warning: Invalid argument supplied for foreach() in *path_to_drupa_site_dirl*/modules/panels/includes/display_edit.inc on line 798.
There are a lot of these, not having counted, I'm guessing one for each category of elements.

The root of the problem seems to be the range() function in the foreach() call on line 798 in display_edit.inc
The range() function is given a third optional argument in display_edit.inc , the step argument (array range  ( mixed $low  , mixed $high  [, number $step  ] )). This is not implemented in PHP 4 (I'm running PHP 4.3) and thus it gives these warnings, failing to return an array and then again causing the foreach call to fail.In addition to that the step argument given is a negative number(range($columns, 2, -1)) and the PHP manual states that the steps argument should be a positive number

If a step value is given, it will be used as the increment between elements in the sequence. step should be given as a positive number. If not specified, step will default to 1.

I removed the third argument and tested. Now the columns where ok but there still seemed to be some CSS missing.

AttachmentSize
Screenshot 112.5 KB

#1

basby - June 30, 2008 - 21:17

Thanks Vidar for this solution! It was the solution to my problem, see http://drupal.org/node/275071.

#2

Vidar Løvbrekke... - July 1, 2008 - 21:45

Glad to be of service...
But I'm not convinced that this fixes the problem. It feels a bit like a hack.

I just can't get my head around why there is a negative number given in this step argument. And if the negative sign is a typo, why set the step argument to 1 as that is the default argument.

#3

sdboyer - July 2, 2008 - 14:44
Status:active» fixed

Indeed, thanks for posting this, Vidar. We've actually already fixed the problem in -dev, but we can use this ticket as a reference for people who also run into the problem.

#4

Caleb G - July 3, 2008 - 22:26
Status:fixed» active

UPDATE: Ignore this comment and see my newer one below - left this here for the purposes of other people who might be tracking similar symptoms.

Setting back to active to note that http://drupal.org/node/275071, which is mentioned as being fix in comment #1 is still an active issue in the issue queue. The waters are getting a little muddied because people are posting differing issues/symptoms to threads they probably don't belong to, so for anyone trying to track it - theses are two other threads that deal with roughly the same type of problems (though I'm not convince they're all exactly same thing):

http://drupal.org/node/275071
http://drupal.org/node/199638

#5

Caleb G - July 3, 2008 - 22:29
Status:active» fixed

Setting back to fixed.

Apparently I didn't do a good job of reading the KNOWN_ISSUES.txt file, whereby it points out that wysiwyg editors have been known to explode panels. In our case it was tinymce. :p

Sorry for the false alarm...

#6

jeremyspouken - July 5, 2008 - 18:53

The fix for removing the 3rd argument in the range() method did the trick.
I'm using PHP Version 4.4.7

Thank You!

#7

jeremyspouken - July 5, 2008 - 18:55

I forgot to say that we experienced this issue after migrating our application from servers running PHP 5.0 to servers running PHP 4.4.7

Hope this helps.

#8

Anonymous (not verified) - July 23, 2008 - 10:56
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.