GetDKAN / dkan

DKAN Open Data Portal
https://dkan.readthedocs.io/en/latest/index.html
GNU General Public License v2.0
366 stars 170 forks source link

Version 7.x-1.12.10 - PHP Parse Error: Unexpected '[' (PHP 5.3.x) #1372

Closed lcshiung closed 7 years ago

lcshiung commented 7 years ago

Hi,

When trying to update DKAN to version 7.x-1.12.10, we encountered a PHP error on line 445 of /profiles/dkan/dkan.profile.

After looking at the file, it is likely because of the use of '[]' for array assignment, which is only supported in PHP 5.4 and above. From the DKAN documentation, it says that PHP 5.3.x and above is supported. Is it the policy to still support PHP 5.3.x?

dafeder commented 7 years ago

@lcshiung you're right. Out testing environment, as stated in the docs, is 5.5, so some things like this can slip through. But we avoid breaking 5.3 compatibility when possible. You could try patching from #1373 for now.

lcshiung commented 7 years ago

Thanks. Btw, I also had to amend the following lines (line 482, 483) of dkan.profile from: 'html' => ['default' => $eid, 'alternative' => 0], 'plain_text' => ['plain_text' => 0, 'alternative' => 0]

to:

'html' => array('default' => $eid, 'alternative' => 0), 'plain_text' => array('plain_text' => 0, 'alternative' => 0)

before it finally works with PHP 5.3.x.

dafeder commented 7 years ago

Thanks, will fix this in the distro for next release as well!

janette commented 7 years ago

Fixed! https://github.com/NuCivic/dkan/pull/1736