The website encountered an unexpected error. ParseError: syntax error, unexpected '=' in

Created on 7 April 2023, over 1 year ago
Updated 21 May 2024, 6 months ago

Problem/Motivation

ParseError: syntax error, unexpected '=' in menu_execute_active_handler() (line 1382 of /sites/all/modules/taxonomy_manager/taxonomy_manager.admin.inc).

Steps to reproduce

I am getting this error after updating module from 1.1 to 1.2

🐛 Bug report
Status

Needs review

Version

1.2

Component

Code

Created by

🇮🇳India Devendra Mishra Noida

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Devendra Mishra
  • 🇩🇪Germany yan

    Similar here when I try to open Taxonomy Manager:

    ParseError: syntax error, unexpected ',', expecting ']' in menu_execute_active_handler() (Zeile 1382 von /sites/all/modules/contrib/taxonomy_manager/taxonomy_manager.admin.inc).

    Version: 7.x-1.2

  • First commit to issue fork.
  • Assigned to shalini_jha
  • 🇮🇳India shalini_jha

    I am checking this issue.

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India shalini_jha

    Hi @Devendra Mishra
    I can not able to reproduce this issue, as the taxonomy manager is working fine for me.
    I am using Drupal core 7.80 , Module Version: 7.x-1.2

  • 🇮🇳India muniraj.m Chennai

    Hi @yan, this error might be due to the usage of older PHP version. For example, if you are using PHP 5.6 then it will throw this error. Use the latest compatible PHP version.

  • 🇩🇪Germany yan

    Thanks muniraj.m. I'm using PHP 7.0.33 in this case. I'll try to update to a newer version.

  • 🇷🇺Russia Andrew Answer Novosibirsk

    Problem is here (taxonomy_manager.admin.inc, line 1382):

    [, , $bundle] = entity_extract_ids('taxonomy_term', $entity);
    

    It is not supported in PHP 7.0.x.

    You should rewrite it as

    $ar = entity_extract_ids('taxonomy_term', $entity);
    $bundle = $ar[2];
    
  • 🇩🇪Germany yan

    Thanks @andrew-answer, that work-around does solve it for now. I imagine that there is no intention to maintain downwards compatibility to PHP 7.0, so probably we'll just leave it at that (and update to a higher PHP version).

Production build 0.71.5 2024