Parse error: syntax error, unexpected '=', expecting ')' in /home/x/public_html/xxx/modules/embed_widgets/embed_widgets_ui/embed_widgets_ui.module on line 1027

CommentFileSizeAuthor
#3 embed_widgets_ui-296809.patch871 bytesjtsnow
#2 Captura_da_tela-3.png293.73 KBxcorex

Comments

jtsnow’s picture

Status: Active » Postponed (maintainer needs more info)

I am unable to find this error. Line 1027 is: function embed_widgets_ui_sort_weight(&$sources = array()) {.

The entire function is as follows:

/**
 * Sort widget sources by weight.
 * 
 * @param $sources
 *   An array of sources.
 */
function embed_widgets_ui_sort_weight(&$sources = array()) {
  $temp = array();
  $weights = array();
  foreach ($sources as $sid => $source) {
      $weights[$sid] = $source['weight'];
  }
  asort($weights);
  foreach ($weights as $sid => $weight) {
    $temp[$sid] = $sources[$sid];
  }
  $sources = $temp;
}

When the code is run, I don't get this error. I'm using Eclipse as an IDE and it doesn't find a syntax error either. And by looking at the code myself, I can't find any error. Can you provide more information?

xcorex’s picture

StatusFileSize
new293.73 KB

Look at the screenshot.

Embed Widgets on
Embed Widgets iFrame on
Embed Widgets UI on
Google Gadgets on
Color Scheme API (6.x-1.0-beta) on
Tabs (6.x-1.x-dev) on

jtsnow’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new871 bytes

Please test the attached patch. Since I am unable to reproduce this error, it is difficult for me to test.

jtsnow’s picture

The reason you are getting this error and I am not is because you are using PHP4. It is highly recommended that you upgrade to PHP5. PHP4 is no longer supported and is no longer receiving security updates.

nedjo’s picture

John, see hook_requirements(), http://api.drupal.org/api/function/hook_requirements/6, for how to require PHP 5.x.

xcorex’s picture

Thank you jtsnow, a lot.

5.2.5 now and working very well.

Congratz!

jtsnow’s picture

Status: Needs review » Fixed

PHP 5 requirement is now specified in the .info file.

Status: Fixed » Closed (fixed)

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