Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | demo-split.patch | 37.87 KB | smk-ka |
Comments
Comment #1
smk-ka CreditAttribution: smk-ka commentedSplit module for 6.x branch.
Comment #2
smk-ka CreditAttribution: smk-ka commentedCommitted to all branches.
http://drupal.org/cvs?commit=149505
Comment #3
smk-ka CreditAttribution: smk-ka commentedNote: 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. :)
Comment #4
sunCool. 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... ;)
Comment #5
smk-ka CreditAttribution: smk-ka commentedWouldn't a permission make more sense in this case? Something like 'reset site', and then just add $form['#access'] = user_access('reset site')?
Comment #6
sunAFAIK, 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).
Comment #7
sunhttp://drupal.org/cvs?commit=286732