Download & Extend

cannot variable_set() anything FALSE using patterns - patch attached

Project:Patterns
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

AttachmentSize
patterns-allow_variables_to_be_set_to_false.patch795 bytes

Comments

#1

Status:needs review» closed (fixed)

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