SondagesPro / LS-arrayTextAdapt

A plugin for LimeSurvey to use dropdown in replace of input in array text
GNU General Public License v3.0
4 stars 3 forks source link

Update arrayTextAdapt.php #2

Closed BertHankes closed 8 years ago

BertHankes commented 8 years ago

Hi Denis,

It's a PHP >5.5 issue... empty() function on null object I made a empty wrapper!

My collegae reported a 500 when trying to create a survey.. I will look into that...

Shnoulle commented 8 years ago

You mean when you don't have array question type in survey ?

I have 5.6 : then i can test and fix : i don't like have a wrapper :/

Shnoulle commented 8 years ago

Think i use

        $aSettings=$event->get('settings',null,null,array());
        if(!empty($aSettings))

Let me check . Maybe only in 2.50 too.

Shnoulle commented 8 years ago

I can not reproduce : and really : empty($nullValue) work best

BUT : LS have bug : https://github.com/LimeSurvey/LimeSurvey/commit/7c3efa819cf00ce466f6c66853c9f1200c1635cc

Check if https://github.com/SondagesPro/LS-arrayTextAdapt/commit/db371b242afdbe6acad66052a784a2e4d68c18a3 fix the issue

BertHankes commented 8 years ago

I just noticed 500 errror on the forum regarding the plugin. And I experienced it to. So I tried to debug and found the empy() problem. And the wrapper fixed the 500. The 500 was when you go the the pluginpage as admin.

When making a new survey and 500 is still a problem I need to debug.. Maybe tonight

BertHankes commented 8 years ago

plugin surveysModel sufferce the same 500.. I just introduced this plugin and the 500 occured

Fatal error: Can't use method return value in write context in /usr/share/ayh/limesurvey_test/plugins/surveysModel/surveysModel.php on line 93

line 93 having empty(), the problem

BTW running on PHP 7.06 (sorry.. just checked)

BertHankes commented 8 years ago

And New Survey also 500 Fatal error: Can't use method return value in write context

BertHankes commented 8 years ago

And my is_empy() wrapper is not the solution either... :-) or :-(

BertHankes commented 8 years ago

https://github.com/SondagesPro/LS-arrayTextAdapt/commit/db371b242afdbe6acad66052a784a2e4d68c18a3 works!!!!

Shnoulle commented 8 years ago

OK, thanks for empty on surveysModel too :), yes there are some empty() test in it.

But are you sure to have the last version of LimeSUrvey https://github.com/LimeSurvey/LimeSurvey/commit/7c3efa819cf00ce466f6c66853c9f1200c1635cc

BertHankes commented 8 years ago

I have 160526 installed

Shnoulle commented 8 years ago

See https://github.com/SondagesPro/LS-arrayTextAdapt/pull/2#issuecomment-222201573