Needs review
Project:
Patterns
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Jul 2010 at 12:39 UTC
Updated:
5 Jul 2010 at 13:23 UTC
Jump to comment: Most recent file
I have a custom pattern containing a block specification as follows:
<block id="user-3">
<status>1</status>
<weight>-4</weight>
<region>left</region>
<visibility>1</visibility>
<pages>
<path>[front]</path>
<path>test</path>
</pages>
</block>
The problem was the 'pages' element wasn't being loaded properly. Specifically, _patterns_rearrange_data() wasn't re-arranging it properly because the 'pages' tag only contained a nested element and no inner text.
The patch below fixes this and ensures that this element (and indeed all other such nested elements for other tags) get re-arranged, and thus loaded properly.
--- C:\Users\Ramesh\AppData\Local\Temp\patterns.module-revBASE.svn000.tmp.module 2010-07-05 13:38:23.000000000 +-0100
+++ Q:\nbc\kola_rnair\src\sites\all\modules\patterns\patterns.module 2010-07-05 13:38:14.000000000 +-0100
@@ -1975,13 +1975,14 @@
function _patterns_rearrange_data($data, $parent = '') {
$numeric = array();
$count=0;
foreach($data as $key => $value) {
- if (!isset($value['value']))
+ ##! Patch to ensure we don't skips tags containing nested data
+ if (!isset($value['value']) && !isset($value['tag']))
continue;
if ($value['value'] == 'false') {
$value['value'] = false;
}
else if ($value['value'] == 'true') {
Patch also attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | patterns.module.patch | 1.21 KB | hiddentao |
| patterns.module.patch | 704 bytes | hiddentao |
Comments
Comment #1
hiddentao commentedBetter patch attached. This prevents PHP Notice messages introduced with first version of the patch.