cannot variable_set() anything FALSE using patterns - patch attached
dman - July 26, 2009 - 12:12
| Project: | Patterns |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Here's an example minimal pattern
All I want is
<?php
variable_set("site_map_show_rss_links", FALSE);
?><?xml version="1.0" encoding="ISO-8859-1"?>
<pattern>
<info><!-- blah blah --></info>
<actions>
<variable name="site_map_show_rss_links">0</variable>
</actions>
</pattern>... does not work due to a line in the middle of system.inc
A common oversight - needed isset().
- if (!$item['value'] && !$item['delete']) {
+ if (! isset($item['value']) && !$item['delete']) {
$value = $item;It actually ends up putting a malformed array into the variable ... which registers as TRUE , so we can never turn things off.
Patch attached.
| Attachment | Size |
|---|---|
| patterns-allow_variables_to_be_set_to_false.patch | 795 bytes |

#1
Nice catch. Fix committed and should be no reason for review here so closing.