UPDATE: Please see #1631846: Server 500 Error while enabling the module.

I tried update to last version 7.x-1.3 and I've got error 500 during update (before db update).

I see at server error log:

PHP Parse error: syntax error, unexpected T_FUNCTION in /sites/all/modules/taxonomy_block/taxonomy_block.module on line 157

Now I've returned to previous version.

Comments

harkonnen’s picture

I'm have same issue as info999.
Parse error: syntax error, unexpected T_FUNCTION in ... sites/all/modules/taxonomy_block/taxonomy_block.module on line 157

Netskill’s picture

Me also
Thanks for help

iouston’s picture

i have the same issue : Parse error: syntax error, unexpected T_FUNCTION in /home/grainecsd1/www/sites/all/modules/taxonomy_block/taxonomy_block.module on line 157

thanks for your help

dimetry’s picture

I've tried to install 7.x-1.3 at pure core Drupal 7.14
The same error 500

paulmacp’s picture

I've tried to install 7.x-1.3 into Drupal 7.14 using drush...

paulmacp@paulmacpherson.org [~/paulmacp]# drush pm-enable taxonomy_block
The following extensions will be enabled: taxonomy_block
Do you really want to continue? (y/n): y

Parse error: syntax error, unexpected T_FUNCTION in /home/paulmacp/public_html/paulmacp.com/sites/all/modules/taxonomy_block/taxonomy_block.module on line 157
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: syntax error, unexpected T_FUNCTION in /home/paulmacp/public_html/paulmacp.com/sites/all/modules/taxonomy_block/taxonomy_block.module, line 157

-- environmental info
Name Installed version Proposed version Status
Views Bulk Operations (views_bulk_operations) 7.x-3.0-rc1 7.x-3.0-rc1 Up to date
Backup and Migrate (backup_migrate) 7.x-2.3 7.x-2.3 Up to date
Drupal 7.14 7.14 Up to date
Browscap (browscap) 7.x-1.3 7.x-1.3 Up to date
CCK (cck) 7.x-2.x-dev 7.x-2.x-dev Up to date
CKEditor (ckeditor) 7.x-1.9 7.x-1.9 Up to date
Colorbox (colorbox) 7.x-1.3 7.x-1.3 Up to date
Chaos tools (ctools) 7.x-1.0 7.x-1.0 Up to date
Custom Pagers (custom_pagers) 7.x-1.x-dev 7.x-1.x-dev Up to date
Devel (devel) 7.x-1.2 7.x-1.2 Up to date
Theme developer (devel_themer) 7.x-1.x-dev 7.x-1.x-dev Up to date
Disqus (disqus) 7.x-1.9 7.x-1.9 Up to date
Entity API (entity) 7.x-1.0-rc3 7.x-1.0-rc3 Up to date
Field collection (field_collection) 7.x-1.0-beta4 7.x-1.0-beta4 Up to date
Field Slideshow (field_slideshow) 7.x-1.6 7.x-1.6 Up to date
google_analytics 7.x-1.2 7.x-1.2 Up to date
Insert (insert) 7.x-1.1 7.x-1.1 Up to date
Libraries (libraries) 7.x-1.0 7.x-1.0 Up to date
Menu Block (menu_block) 7.x-2.3 7.x-2.3 Up to date
Mobile Theme (mobile_theme) 7.x-1.2 7.x-1.2 Up to date
Pathauto (pathauto) 7.x-1.1 7.x-1.1 Up to date
Token (token) 7.x-1.1 7.x-1.1 Up to date
Views (views) 7.x-3.3 7.x-3.3 Up to date
XML sitemap (xmlsitemap) 7.x-2.0-rc1 7.x-2.0-rc1 Up to date
Taxonomy Block (taxonomy_block) 7.x-1.3 7.x-1.3 Up to date

loko’s picture

Same error here.

mjross’s picture

Title: Error 500 after update to 7.x-1.3 » Fixed bug of inline comparison function in usort (with a patch)
Status: Active » Needs review
StatusFileSize
new577 bytes

PHP's usort() does not support anonymous inline functions. This patch fixes the erroneous code in taxonomy_block.module.

dimetry’s picture

I've applied patch.
And I can install module without errors now.
But when I try to view page with taxonomy block - I have error 500:

PHP Fatal error:  Call to undefined function i18n_langcode() in 
../sites/all/modules/taxonomy_block/taxonomy_block.module
mgzrobles’s picture

the same

mjross’s picture

With the patch applied, I'm able to use the module, and do not see any i18n_langcode() error. Perhaps it only shows up if multiple languages are being used on the website (which is not the case for the sandbox Drupal 7 instance I was using for testing the patch).

mjross’s picture

This should be reported as a separate issue, because it appears to be unrelated to the problem caused by the inline comparison function.

leopardman’s picture

How do I apply this patch? Is there an area in the control panel or do I modify the code in the taxonomy_block.module directly?

fantom84’s picture

I changed line 94 in the taxonomy_block.module

$langcode = i18n_langcode();

to

  if(module_exists('i18n')) {
    $langcode = i18n_langcode();
  }

and error gone away
but i don't understand why we need use $langcode = i18n_langcode(); in the taxonomy_block_block_view function
variable $langcode not use in that function

Mohamed Farag’s picture

Drupal 7.15

The code doesn't work for me

I get it just as soon as I clicked the L Save configuration button after making the module enabled.
Error gone away when I unenabled the mod.

I didn't try the patch

cwithout’s picture

Status: Needs review » Closed (duplicate)

Closing this issue as a duplicate of #1631846: Server 500 Error while enabling the module.

I've just added a dev release for this module . It should be available on the project page once the system process it. I would like to move that to a new Taxonomy Block 7.x-1.4 release after testing.

When the dev becomes available, please test. Post results to #1631846: Server 500 Error while enabling the module.

cwithout’s picture

Issue summary: View changes

Add link to currently open issue.