Demo is widely used as developer tool only. So all demonstration site features should go into a sub-module demo_reset, to avoid Demo's blocks from showing up in the block configuration and also save some cycles.

Additionally, Demo should leverage new file handler attributes in D6, so all administrative forms and features go into a demo.admin.inc. For D5, this should use a helper function in demo.module that includes admin.inc and invokes the corresponding function, so the differences between D5 and D6 are kept at a minimum.

CommentFileSizeAuthor
#1 demo-split.patch37.87 KBsmk-ka
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

smk-ka’s picture

FileSize
37.87 KB

Split module for 6.x branch.

smk-ka’s picture

Status: Active » Fixed

Committed to all branches.
http://drupal.org/cvs?commit=149505

smk-ka’s picture

Note: With demo.module now weighting at ~4KB I don't believe it would make sense to further split the module apart. Feel free to open a new issue if you disagree. :)

sun’s picture

Status: Fixed » Active

Cool. 8)

However, the point of this issue was that when Demo module is used on regular sites where maybe novice users are allowed to configure blocks, users can easily wreck their sites by (mistakenly) publishing the Demo Reset block and wait for the next visitor... ;)

smk-ka’s picture

Wouldn't a permission make more sense in this case? Something like 'reset site', and then just add $form['#access'] = user_access('reset site')?

sun’s picture

AFAIK, a permission would lead to the block not being displayed on admin/build/block if a user has not sufficient permissions. If that user submits the form, all blocks are rehashed, and if the block was enabled (for any reason / special visibility configuration), it would be disabled afterwards.

This will also allow us to maybe place the new links discussed in #294837: Make snapshot now (quick menu item without any kind of confirmation) in demo_reset module, if that makes sense (to be discussed over there).

sun’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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