Features

  • Enable themes, and set them as default (administrator default)
  • Create, modify and delete system variables
  • Enable/disable modules with dependants
  • Execute PHP functions
  • Fill in forms

Available Tags

  • theme
  • variable
  • module
  • call_php_func
  • form

Automatic extraction of patterns files status

Yes, supported in versions >= 7.x-2.x

Examples

Theme tag

# YAML Theme Pattern
# QScience

info:
  title: Set theme
  description: as title
  author: QScience
  category: System
  version: 1.0
  core: 7.x
  author_website: qlectives.eu

actions:

    - create:
        tag: theme
        value: garland
        default: true

    - create:
        tag: theme
        value: bartik
        default: true
        admin: true


Variables tag

# YAML Variables Pattern
# QScience

info:
  title: Modify variables
  description: New test case adapted to new syntax
  author: QScience
  category: System
  version: 1.0
  core: 7.x
  author_website: http://qlectives.eu/

actions:
  - modify:
      tag: variables
      - variable
        name: user_picture_file_size
        value: 800
      - variable
        name: user_register
        value: 1

Modules tag

# YAML Modules Pattern
# QScience

info:
  title: Enable/disable modules
  description: Based on drupal.org/node/408960
  author: QScience
  category: System
  version: 1.0
  core: 7.x
  author_website: qlectives.eu

actions:

  - create:
      tag: modules
      - value: forum
      - value: number

  - delete:
      tag: modules
      - value: admin_menu
      - value: overlay
      - value: aggregator

Call_php_func tag

# YAML PHP Function Pattern
# QScience

info:
  title: Execute PHP functions
  description: Runs a simple dvm function from the Devel module.
  author: QScience
  category: System
  version: 1.0
  core: 7.x
  author_website: qlectives.eu

modules:
  - devel

actions: 
  - create:
      tag: call_php_func
      function: dvm
      arguments:
          - array:
              - abcString
              - defArray:
                  - item1
                  - item2

Form tag

# YAML Forms Pattern
# QScience

info:
  title: Fill in values for forms
  description: Based on drupal.org/node/516332
  author: QScience
  category: System
  version: 1.0
  core: 7.x
  author_website: qlectives.eu

modules:
  - system

actions: 
  - create:
      tag: form
      form_id: system_performance_settings
      cache: 1
#      include: "modules/system/system.admin.inc"

  - create:
      tag: form
      form_id: user_admin_settings
      anonymous: Anonymous2


Comments

xxronis’s picture

Most of these examples do not pass YAML to XML converter (You cannot define a sequence item when in a mapping) and i can't find a way to convert , for example the Variable tag example above into XML format.With the obvious i get validation errors in Patterns administration. (missing name and value attributes).

i consider the obvious like:

info:
  title: Modify variables
  description: New test case adapted to new syntax
  author: QScience
  category: System
  version: 1.0
  core: 7.x
  author_website: http://qlectives.eu/
actions:
 - modify:
    tag: variables
    - variable
      name: user_picture_file_size
      value: 800
<pattern>
 <info>
    <title>Modify variables</title>
    <description>New test case adapted to new syntax</description>
    <author>Qscience</author>
    <category>System</category>
    <version>1.0</version>
    <core>7.x</core>
</info>
<actions>
    <modify tag="variables">
        <variable name="user_picture_file_size">800</variable>
        <!--<variable name="max_amount_limits" value="6000"/>-->?
    </modify>
</actions>

What's the score here?what's next?