Hi,
I've experienced tha same issue reported in http://drupal.org/node/449332 that is, trying to disable a module doesn't work.
I used the following syntax, as suggested by Vaish but it doesn't work.

<?xml version="1.0" encoding="ISO-8859-1"?>
<pattern>
  <info>
    <title>Simple Disable</title>
    <description>Simply disable a mode</description>
    <author>Erik LaBianca</author>
    <author_email>erik@quonic.com</author_email>
    <version>0.1</version>
    <author_date>2009-04-24</author_date>
    <category>Modules</category>
    <core>5.x</core>
  </info>
  <actions>
    <modules>
      <module delete="1">xmlsitemap_engines</module>
      <module delete="1">xmlsitemap</module>
    </modules> 
  </actions>
</pattern>

Has any of you experienced/resolved the same issue?
Thank you,
Alessandro

CommentFileSizeAuthor
#8 error616.jpg48.22 KBcolinmcclure

Comments

alessandroronchi’s picture

Hi,
after some code investigation on patterns.module it turned out that the patterns_sync_form_values function, used to "fix some parts of the #post values based on the original form" in the patterns_execute_action function re-enables the modules which were told to be disabled/deleted via patterns.

Still investigating, this was to keep trace of any step torward a solution.

Regards, Alessandro

alessandroronchi’s picture

Hi,
we discovered that the problem is not strictly bound to disabling modules.
We experienced the same issue by using the form tag trying to disable a form option (unchecking the corresponding checkbox).

I confirm that the patterns_sync_form_values function mentioned in the previous comment is responsible of this behaviour.

Regards, Alessandro

vaish’s picture

Hi Alessandro,

You are right about this issue not being specific only to disabling modules. It's related to disabling checkboxes in general and caused by patterns_sync_form_values not handling disable attribute properly. You can expect fix for this issue very soon.

Vaish

dman’s picture

bump.
I can't see a fix for this in current dev. Is it in, or should it be worked on?

I looked at patterns_sync_form_values but it's scary.

vaish’s picture

Status: Active » Fixed

Fix for this issue finally got committed. It required adjusting the syntax for modules action in order to make it consistent with the syntax used in other places where multiple checkboxes are handled. This is the new syntax:

    <modules delete="1">
      <module>xmlsitemap_engines</module>
      <module>xmlsitemap</module>
    </modules> 

Thanks everyone for your patience.
Vaish

colinmcclure’s picture

I have a fresh installation of Drupal 6.16 with Patterns module as of 12 March 2010 installed however I am able to enable modules through Pattern but not disable?

<?xml version="1.0" encoding="ISO-8859-1"?>
<pattern>
  <info>
    <title>Enable Core Items</title>
    <category>Setup</category>
    <core>6.x</core>    
	<version>0.5</version>
  </info>  
<actions>
<modules enable="1">
	<module>aggregator</module>
	<module>poll</module>
</modules>

	<modules delete="1">
      <module>color</module>      
    </modules> 
 
</actions>
</pattern>
vaish’s picture

drupalleppie,

Your pattern worked fine for me, both enable and disable. Could you please try once again and let me know how it goes.

Also, there is no need to specify enable="1". Enable module is default behavior when nothing is specified.

colinmcclure’s picture

StatusFileSize
new48.22 KB

Hi vaish,

Have tried again however getting error as per screenshot.

I am running WAMP Server 2.0 with PHP 5.3.0.

colinmcclure’s picture

Status: Fixed » Active

All working now ;) Reverted the version of php 5.3.0 on my WAMP Server to 5.2.11 and all is working now!

vaish’s picture

Status: Active » Fixed

Drupal 6 is still not entirely compatible with PHP 5.3. You can get more info about that here:

http://drupal.org/requirements
http://drupal.org/node/360605

You may need to downgrade your PHP version to 5.2.x.

vaish’s picture

You beat me to it :)

I'm glad all is working now.

Status: Fixed » Closed (fixed)
Issue tags: -module, -actions, -modules, -patterns, -disable, -disabling

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