I'm getting a number of PHP "Notice" messages showing up when using patterns. E.g.:

Notice: Undefined index: id in user_patterns() (line 121 of Q:\nbc\kola_rnair\src\sites\all\modules\patterns\components\user.inc).
Notice: Undefined index: delete in block_patterns() (line 62 of Q:\nbc\kola_rnair\src\sites\all\modules\patterns\components\block.inc).
Notice: Undefined variable: errors in patterns_prepare_actions() (line 1501 of Q:\nbc\kola_rnair\src\sites\all\modules\patterns\patterns.module).
Notice: Undefined index: abort in patterns_batch_finish() (line 1549 of Q:\nbc\kola_rnair\src\sites\all\modules\patterns\patterns.module).

Patches attached.

Comments

hiddentao’s picture

StatusFileSize
new2.75 KB

Better block.inc patch attached. This uses isset() rather than empty() when checking block 'delta', thus allowing for delta to be 0.

vaish’s picture

Status: Patch (to be ported) » Needs work

Applying this patch failed. It seems that it was created against either wrong or outdated version of patterns module. For example:

patterns.module.patch contains the following:

-  while ($current = $data[$index]) {
+  while (isset($data[$index]) && ($current = $data[$index])) {

while current 6.x dev version of patterns module contains this:

  while (isset($data[$index]) && $current = $data[$index]) {

Basically lots of PHP notices where already fixed some time ago including the above one. See: #446068: E_ALL compilance

6.x-1.x-dev corresponds to DRUPAL-6--1 CVS branch and that's where all D6 development is happening and what needs to be used for creating patches.