E107: FAQ plugin - parse error because concatenation LAN strings

Created on 2 Sep 2017  路  9Comments  路  Source: e107inc/e107

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

bug

All 9 comments

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....

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().

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....

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

@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.

Did the pull-request fix it?

Fixed. Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chory picture chory  路  4Comments

CaMer0n picture CaMer0n  路  4Comments

Jimmi08 picture Jimmi08  路  3Comments

Jimmi08 picture Jimmi08  路  5Comments

rica-carv picture rica-carv  路  5Comments