Using POTX module (both versions potx-5.x-1.2 and potx-5.x-1.x-dev, same error). Site: Drupal 5.10 and every module installed up to date:

The potx module stalls when a module with texts to be extracted contains a mistake of some type in its syntaxis. Result: No po/pot file and blank screen followed (when F5) by a message:

"Invalid argument supplied for foreach() in line 1074 of file  /home/mysitename/public_html/sites/default/modules/contrib/potx/potx.inc.

Invalid argument supplied for foreach() en la línea 469 del archivo /home/mysitename/public_html/sites/default/modules/contrib/potx/potx.inc.

Invalid argument supplied for foreach() en la línea 150 del archivo /home/mysitename/public_html/sites/default/modules/contrib/potx/potx.module.

Invalid argument supplied for foreach() en la línea 1082 del archivo /home/mysitename/public_html/sites/default/modules/contrib/potx/potx.inc.

array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array en la línea 1076 del archivo /home/mysitename/public_html/sites/default/modules/contrib/potx/potx.inc.

Invalid argument supplied for foreach() en la línea 1074 del archivo /home/mysitename/public_html/sites/default/modules/contrib/potx/potx.inc.

Invalid argument supplied for foreach() en la línea 1074 del archivo /home/mysitename/public_html/sites/default/modules/contrib/potx/potx.inc.

(severity for them all: error)

This happened when trying to extract messages from paging.module (version 5.x-1.x-dev), which contains at least three bad text strings because of double quotes not properly nested/escaped (I believe, not dead sure).

Otherwise, the potx module works perfectly and a po/pot file is generated from any module (tested using the different options included in potx, by the way).

Thing is that this behaviour of potx makes impossible to extract anything from a 'missconfigured' module, even if it's just one tiny syntaxis mistake (or not? :( ).

Thank you for your interest and work :)

Gustavo (Posted from Spain).

Comments

gábor hojtsy’s picture

Status: Active » Fixed

Looks like the glob() calls had some error there and that escalated. I've added a few checks, so that if the glob() finds any problems, it will not escalate from there and finally, when an empty string set is found, there will be no error on output. This should get you to no such errors.

Why did the glob() return you bad results for paging module, I don't understand, I cannot see any special things in paging module's directory structure. Please recheck with latest development version or wait for the next stable release and reopen the report if the errors are not resolved.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.