e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

FAQ plugin - parse error because concatenation LAN strings #2778

Closed Jimmi08 closed 6 years ago

Jimmi08 commented 7 years ago

Latest github

After installing FAQ plugin: Parse error: syntax error, unexpected '.', expecting ')' in C:\xampp\htdocs\e107v2.1.6v\e107_plugins\faqs\admin_config.php on line 232 Reason: concatenation strings in admin_ui is not allowed: protected $preftabs = array(LAN_GENERAL, LAN_FAQS_ASK_A_QUESTION, LAN_MANAGE.": ".LANA_FAQ_QUESTIONS, LAN_MANAGE.": ".LAN_CATEGORIES);

Parse error: syntax error, unexpected '.', expecting ')' in C:\xampp\htdocs\e107v2.1.6v\e107_plugins\faqs\admin_config.php on line 250

'orderby' => array('title'=> LAN_ORDER, 'tab'=>0, 'type'=>'dropdown', 'writeParms'=>array('faq_order-ASC'=>LANA_FAQ_PREF_16, 'faq_id-ASC'=>LAN_ID." ".LAN_ASC, 'faq_id-DESC'=>LAN_ID." ".LAN_DESC, 'faq_datestamp-ASC'=>LAN_DATE." ".LAN_ASC, 'faq_datestamp-DESC'=>LAN_DATE."-".LAN_DESC)),

After left only clean LAN strings, error is solved.

PHP 5.6 Only English lang file

Jimmi08 commented 7 years ago

https://e107help.org/3705/error-on-faqs-plugin

Jimmi08 commented 7 years ago

It was changed in this commit: https://github.com/e107inc/e107/commit/0fa1246b6173919e3ba57c7f3aa28204d54885cc

tgtje commented 7 years ago

Idea but no time now... what happens when " become ' (double to single) I can not check as i have no real error reported.. By editor (pspad) it displays it accepts it....

Jimmi08 commented 7 years ago

I wasn't never able to use more than one LAN string as value in admin_ui(). I always need to concate them in lang file, not in admin_ui().

rica-carv commented 7 years ago

Err, @Jimmi08, i can, althought in a "perverted" way.... define("LAN_EUSER_ADMIN_COLORH", LAN_EUSER_ADMIN_CLICKHERESTART.LAN_EUSER_ADMIN_PICKCOLOR); I define it outside of the class (but inside admin_config.php), and then use LAN_EUSER_ADMIN_COLORH inside the class....

Moc commented 7 years ago

This needs to be cleaned up in the language file. On my to-do.

Jimmi08 commented 6 years ago

@CaMer0n I noticed that this is problem on php 5.5 , on site with php7 it works.

this code (notice SCONTENTC_ADMIN_PAGE."?99) :

protected $adminMenu = array(
...
     "SCONTENTC_ADMIN_PAGE_99" => array("text" => SCONTENT_LAN_ADMIN_MENU_99, "link" => SCONTENTC_ADMIN_PAGE."?99", "form" => false),
    ); 

worked on php 7, but using it with xampp 5.5 I've got the same error about dot.

CaMer0n commented 6 years ago

Did the pull-request fix it?

Jimmi08 commented 6 years ago

Fixed. Thank you