ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
922 stars 217 forks source link

Error when updating today #426

Closed maod321 closed 9 years ago

maod321 commented 9 years ago

Updated Unyson plugin to day and ok until updated extensions then Parse error: syntax error, unexpected '[' in /home15/ommanage/public_html/wp-content/plugins/unyson/framework/extensions/events/extensions/events-tags/class-fw-extension-events-tags.php on line 394.

ghost commented 9 years ago

There is used a php 5.4 feature

$value = some_function_that_returns_an_array()['array_key'];

which violates our (and WordPress) no php 5.3+ features convention.

It will be fixed in the next Events version. Until then, you can fix it manually:

Open unyson/framework/extensions/events/extensions/events-tags/class-fw-extension-events-tags.php line 394, and replace:

$language = substr( wpml_get_language_information( $post_id )['locale'], 0, 2 );

with

$language_information = wpml_get_language_information( $post_id );
$language = substr( $language_information['locale'], 0, 2 );
unset($language_information);

Thank you for the report.

ghost commented 9 years ago

https://github.com/ThemeFuse/Unyson-Events-Extension/commit/5877990f7f44d3015d8e9542aef1ac8e0f0ab602?diff=unified#diff-d79dced1ba15ade03f0e75e33d301091R365

thednp commented 9 years ago

I also want to point out an issue on update (I don't remember exactly if this happens when updating the plugin or it's extensions, but I strongly believe it has to be when updating extensions, they usually take more time):

You must WRITE A RED BOLD CLEAR NOTE: don't close or leave the window while update is processing, because (see details above) Google Chrome kills running scripts on window focus out)

GheorgheP commented 9 years ago

Hi @thednp,

I just tried out this and don't get such problem. Could you provide a step by step scenario? Also, try one more time by deactivating all extensions of you browser.

thednp commented 9 years ago

OK, will do that with the next extensions and plugin update. But I am very sure Google Chrome is doing that (among many others), mostly for performance reasons.

FYI: my only extensions are adBlock and Tampermonkey (for Themeforest stuff).

GheorgheP commented 9 years ago

Hi,

You can go in the manifest.php of each extension and set it to a lower version and try one more time

Nic787 commented 9 years ago

I got this error too last week when updating. Thank you to write how to fixe that.

GheorgheP commented 9 years ago

@Nic787, same scenario how @thednp described?

Nic787 commented 9 years ago

I had the same error, but now it work with the last update.

GheorgheP commented 9 years ago

Hi,

Did anyone else get this problem? Because I'm trying to get the problem, but all seems to work fine.

Nic787 commented 9 years ago

Everything work fine.

GheorgheP commented 9 years ago

Does someone still get this problem or we can close the issue?

thednp commented 9 years ago

I believe you can close it for now. If I get my error again, will open a new issue with detailed replicate guide.

maod321 commented 9 years ago

You can close now thanks for your help