Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:adddefaultstates

Give every content object the default state of each state group it has no state of (dry run unless --apply).

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/adddefaultstates.md

On this page

exp:adddefaultstates

Give every content object the default state of each state group it has no state of (dry run unless --apply).

Script bin/php/adddefaultstates.php, code in kernel/private/classes/commands/adddefaultstates.php. Run it from the installation root, as the user the web server runs as:

./console exp:adddefaultstates --help
php bin/php/adddefaultstates.php --help

Help text

Adds default states to content objects: every object that has no state of a state group gets
the group's default state (the state with priority 0). Objects with a state of the group are left
alone, so the script can run again. Prints PASS or FAIL at the end.
Without --apply nothing is written: the script lists per state group how many objects would get
its default state. --dry-run means the same as no flag; --apply together with --dry-run is a usage
error (exit 2).

Example: php bin/php/adddefaultstates.php
         php bin/php/adddefaultstates.php --apply

Options

OptionValueHelp
--applyAdd the states (the default is a dry run that lists them and changes nothing)
--dry-runThe default: list how many objects would get a default state, change nothing

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/adddefaultstates.php, kernel/private/classes/commands/adddefaultstates.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x