1

Topic: problem with "preg_match() expects parameter 2"

Hello. i'm updating (or trying to update) Iform for Drupal7 but i get these errors:

Warning: preg_match() expects parameter 2 to be string, array given in iform_configuration_form() (line 198 of /var/www/drupal-7.36/sites/all/modules/iform/iform.admin.inc).

Warning: preg_match() expects parameter 2 to be string, array given in iform_configuration_form() (line 202 of /var/www/drupal-7.36/sites/all/modules/iform/iform.admin.inc).

Warning: strlen() expects parameter 1 to be string, array given in drupal_validate_utf8() (line 1866 of /var/www/drupal-7.36/includes/bootstrap.inc).

The Iform i have downloaded is IForm.module.for.Drupal.7.complete.including.submodules.zip

Any suggest to solve the problem?

Carlo Politi - Software Engineer
QuestIT s.r.l.
Home page: www.quest-it.com
E-Mail: politi@quest-it.com - Skype: carlo.politi.questit

2

Re: problem with "preg_match() expects parameter 2"

Hi Carlo

If I look in the file iform/iform.admin.inc and search for those lines causing the error I see that the second parameter in the preg_match calls is $config['subtype']

$config is an element of the $vars array that is being looped through and $vars is obtained from invoking hook_variable_info.

This gets information from all indicia related modules, allowing them to add settings to the admin page.

My suspicion is that the format of the information has changed and that the updated module is picking up something from an older module which is not compatible. My suggestion is that you temporarily disable all the indicia modules except the new iform module and see if the fault goes away.

Jim Bacon.

3

Re: problem with "preg_match() expects parameter 2"

By the way, you have downloaded the code from
https://github.com/Indicia-Team/drupal- … tag/v1.1.0

There is a more up to date complete module download at
https://github.com/Indicia-Team/drupal- … ag/v1.21.0

This is still not the latest version of the code but it does appear to be the most recent package of the module, client_helpers and media.

Jim Bacon.

4

Re: problem with "preg_match() expects parameter 2"

Jim Bacon wrote:

By the way, you have downloaded the code from
https://github.com/Indicia-Team/drupal- … tag/v1.1.0

There is a more up to date complete module download at
https://github.com/Indicia-Team/drupal- … ag/v1.21.0

This is still not the latest version of the code but it does appear to be the most recent package of the module, client_helpers and media.

Jim Bacon.

Hi Jim,
i have downloaded now from your last link (1.21.0) but i continue to get error on these lines:

          if (isset($config['subtype']) && preg_match('/^termlists_term:(?P<lis$
            $type = 'select';
          }
          elseif (isset($config['subtype']) && preg_match('/^(?P<table>[a-z_]+)$
            $type = 'select';
          }


    Warning: preg_match() expects parameter 2 to be string, array given in iform_configuration_form() (line 211 of /var/www/drupal-7.36/sites/all/modules/iform/iform.admin.inc).
    Warning: preg_match() expects parameter 2 to be string, array given in iform_configuration_form() (line 214 of /var/www/drupal-7.36/sites/all/modules/iform/iform.admin.inc).

the $config variable, what should contain and where can i set the right values?

Carlo Politi - Software Engineer
QuestIT s.r.l.
Home page: www.quest-it.com
E-Mail: politi@quest-it.com - Skype: carlo.politi.questit

5

Re: problem with "preg_match() expects parameter 2"

I get this odd behaviour when i try to use the search: i write something in the input box to find the taxa (for example "fringuello") and i don't see nothing on the page (no drop down list or nothing), BUT i see the JSON result of the call in the console:

jsonp1487783316517([{"id":"4052","taxon_id":"3839","taxon":"Fringuello","authority":null,"language_iso":"ita","common":null,"taxon_list_id":"27","taxon_list":"Uccelli","taxon_meaning_id":"5400","preferred":"t","taxonomic_sort_order":null,"description_in_list":null,"general_description":"Fringilla coelebs","parent_id":null,"parent":null,"image_path":null,"image_caption":null,"created_by_id":"1","created_by":"admin","updated_by_id":"1","updated_by":"admin","external_key":"603.0.001.0","allow_data_entry":"t","preferred_authority":null},{"id":"4051","taxon_id":"3838","taxon":"Fringuello alpino","authority":null,"language_iso":"ita","common":null,"taxon_list_id":"27","taxon_list":"Uccelli","taxon_meaning_id":"5399","preferred":"t","taxonomic_sort_order":null,"description_in_list":null,"general_description":"Montifringilla nivalis","parent_id":null,"parent":null,"image_path":null,"image_caption":null,"created_by_id":"1","created_by":"admin","updated_by_id":"1","updated_by":"admin","external_key":"602.0.001.0","allow_data_entry":"t","preferred_authority":null}])

Any idea?

Post's attachments

Appunti Windows-1.jpg 142.92 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.
Carlo Politi - Software Engineer
QuestIT s.r.l.
Home page: www.quest-it.com
E-Mail: politi@quest-it.com - Skype: carlo.politi.questit

6

Re: problem with "preg_match() expects parameter 2"

I see a problem this now:

18:24:55.496 TypeError: item.language is undefined 1 7:163:1
    .formatItem http://www.naturaesocialmapping.it/node/7:163:1
    fillList http://www.naturaesocialmapping.it/site … .js:773:23
    $.Autocompleter.Select/<.display http://www.naturaesocialmapping.it/site … e.js:802:7
    receiveData http://www.naturaesocialmapping.it/site … e.js:422:7
    request/<.success http://www.naturaesocialmapping.it/site … .js:471:11
    .handleSuccess http://www.naturaesocialmapping.it/misc … js:143:438
    .ajax/E[d] http://www.naturaesocialmapping.it/misc … js:137:389
    <anonimo> http://postgres.comune.grosseto.it/Indi … n_list:1:1

Carlo Politi - Software Engineer
QuestIT s.r.l.
Home page: www.quest-it.com
E-Mail: politi@quest-it.com - Skype: carlo.politi.questit