system/plugins/menus/menus.plugin.php had syntax errors and could not load

40 views
Skip to first unread message

David

unread,
Jan 22, 2014, 11:54:02 PM1/22/14
to habari...@googlegroups.com
I upgraded my old 0.9 installation by cloning the Habari repo as per the instructions at http://wiki.habariproject.org/en/Habari_on_github#Installing_Habari_From_Git into a new directory.  (I did not follow the instructions for "Updating to the in-development version of Habari" as I only want the released version of Habari, not the in-development version.)

Then I moved my old 0.9 config.php and /user's theme, files and a few plugins into the new installation. Most everything works correctly.

The /admin page indicates I have version 0.9.2, but I thought I was only sync'ing to 0.9.1.  Is it expected that I have 0.9.2?

The admin/plugins page displays the following error on "Inactive Plugins":

The plugin file .../system/plugins/menus/menus.plugin.php had syntax errors and could not load.
Parse error: syntax error, unexpected '[' in.../system/classes/utils.php(752) : eval()'d code on line 603

Red text at the bottom of the page also says, "Parse Error: syntax error, unexpected '[' in system/classes/utils.php(752) : eval()'d code line 603"

That's one of the system plugins, so I didn't expect this error.  (If it helps: The user plugins are autoclose 0.3, comment_notifier 1.2, gravatar 1.3.2, markup 0.6 and recentcomments 1.4.1.) Any tips on what I can do to get rid of the error?

Thank you,
--David

Chris Meller

unread,
Jan 23, 2014, 2:23:41 AM1/23/14
to Habari Users
It says you’re running 0.9.2 because we actually started to release 0.9.2 before we found one more thing we need to fix with it. Nothing that would relate to this problem, so don’t worry about that.

Could you post the contents of the menus.plugin.php file to Pastebin or a Github Gist? I’m not sure what the problem with that plugin could be (I just checked, it looks fine), so that’s as good a place to start as I’ve got at the moment.

If you just want to get rid of it, you could simply delete the system/plugins/menus directory, but if you don’t mind troubleshooting we’d appreciate the help tracking down the cause.


David

unread,
Jan 23, 2014, 4:02:12 AM1/23/14
to habari...@googlegroups.com
Thanks for the quick reply.  I realize that this pretty much has to be my fault, but I'm surprised. I'm usually very good about keeping myself to the right directories.  In case my mistake shows up in my history, here's some of it:

$ history | grep -P "(git|htdocs)"
  431  which git
  434  git clone https://github.com/habari/habari.git htdocs
  436  cd htdocs/
  438  git submodule update --init
  465  mv blog-0.91/htdocs/ blog

Here's the actual menus.plugin.php I got: https://gist.github.com/dblume/8575152

I'd be willing to stomp my sandbox if I knew the correct git command to force overwrite with the correct version.

Also, the new menus.plugin.php is not an accidental copy of the one from my 0.9 version, because they're different:

$ diff menus.plugin.php ../../../blog-0.9-delete-me/system/plugins/menus/menus.plugin.php
601,613d600
<                                       // Delete blocks using this menu
<                                       $at = Themes::get_active_data( true );
<                                       $t = Themes::create(Themes::get_active()['name']);
<                                       $i = 0;
<                                       foreach($at['areas'] as $area) {
<                                               foreach($t->get_blocks($area['name'], 0, $t) as $block) {
<                                                       if( $block->type == 'menu' && $block->menu_taxonomy == $handler->handler_vars[ 'menu' ] ) {
<                                                               $block->delete();
<                                                               $i++;
<                                                       }
<                                               }
<                                       }
<                                       Session::notice( sprintf( _n( '%s block linking to this menu deleted.', '%s blocks linking to this menu deleted.', $i), $i ) );
838c825
<                       $config[ 'wrapper' ] = str_replace('%', '%%', sprintf( $config[ 'linkwrapper' ], "<a href=\"{$link}\">{$title}</a>" ));
---
>                       $config[ 'wrapper' ] = sprintf( $config[ 'linkwrapper' ], "<a href=\"{$link}\">{$title}</a>" );

Thanks again,
--David

David

unread,
Jan 26, 2014, 7:47:47 PM1/26/14
to habari...@googlegroups.com
I installed Habari at a new location:

$ cd menusbug/; git submodule update --init

Then I browsed to my new menusbug site, and saw the initial setupweb page.  I selected Database Type sqlite, and got a red error at the bottom of the page, "Parse Error: syntax error, unexpected '[' in system/classes/utils.php(752) : eval()'d code line 603"

I selected mysql again, and the error went away.  I finished setup with a mysql database, and successfully made my new blog (ignoring another Parse Error).  Logged in to the admin page, and navigated directly to Plugins.

The same symptom happened again.

It's pretty easy to reproduce if you follow the instructions I supply above.  Should this be reported as a bug?

--David

Chris Meller

unread,
Jan 26, 2014, 8:05:32 PM1/26/14
to Habari Users
What version of PHP are you running?

David

unread,
Jan 29, 2014, 3:38:13 PM1/29/14
to habari...@googlegroups.com
PHP Version 5.3.27.  Here's phpinfo: http://david.dlma.com/habari-phpinfo-temporary-file.php

I'll delete that file after a while.

So you're not experiencing the same issue when you clone and update into a brand new local sandbox? How odd that I'm seeing it then.

--David
Reply all
Reply to author
Forward
0 new messages