Attempt to upgrade from ver 1.4 to 1.5-beta1 with "drush up insert-1.5-beta1" fails with errors

Error: Arrays are not allowed as constants in /insert.module, line 18
PHP Fatal error: Arrays are not allowed as constants in /insert.module on line 18

Fatal error: Arrays are not allowed as constants in /insert.module on line 18

Not sure which commit introduced this.

CommentFileSizeAuthor
#4 insert-3009874-constants.patch2.93 KBsnater

Comments

izmeez created an issue. See original summary.

izmeez’s picture

Issue summary: View changes
snater’s picture

Thanks for opening the ticket. Which PHP version are you using? It seems you are still using a version prior to 5.6, which introduced allowing arrays as constants.

snater’s picture

StatusFileSize
new2.93 KB

The attached patch should ensure compatibility to PHP 5.4. But there might be additional conflicts, so it would be great if someone tested the change. I am aware that there are changes that are not compatible with PHP < 5.4. While Drupal 7 has a minimum requirement of PHP 5.2.5, 5.4 is the recommended minimum. Not sure, we really need to support PHP < 5.4. 5.6's end of life will be at the end of this year.

  • Snater committed 1e3e7b2 on 7.x-1.x
    Issue #3009874: Made constants compatible to PHP 5.4
    
snater’s picture

Status: Active » Fixed
izmeez’s picture

I am using different versions of php on servers and yes, this occurred on server with php 5.4.x

The fix resolves the issue. Thank you.

Status: Fixed » Closed (fixed)

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