I am trying to delete the example rule set installed by the module, but I don't see anything that permits such thing.
Is there a way to actually do it?

Thanks in Advance.

Comments

fago’s picture

Status: Active » Fixed

No, there is no way - as this rule set is a default rule set. However I think I'll remove this default rule set from the module.

avpaderno’s picture

I would leave the example rule set, but I would load it in the database when the module is being installed; in that way, it would appear like one created by the user, and the user would be able to delete it whenever he wants.
At the moment the example rule set, and rule are loaded at runtime from a file; that means they will appear all times the admin interface is presented.

fago’s picture

Title: Is there a way to delete a rule set? » make rules' example rule set deleteable
Category: support » task
Status: Fixed » Active

that sounds to make sense - thanks for the suggestion. I think I'll follow that.

amitaibu’s picture

I think it's better to keep it un-deletable. default rules are made for newbies, that might delete it by mistake. You can't delete default views as well, only disable them.

avpaderno’s picture

The case of the views is different, as the default views are the ones provided by some modules (including the core ones).
The rule sets are just provided as example, and they don't do anything useful (except that they can modified from the user).

fago’s picture

hm, no in general default rules are intended to something - not as example. Only the provided one is intended to be an example, so yes it should be deletable. I think best is we change it to not be a default rule set, but just configure it as a usual rule set when the module is activated.

mitchell’s picture

Title: make rules' example rule set deleteable » Investigate default/example rules & rule set installation type
Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Component: Code » Rules Engine
Status: Active » Postponed (maintainer needs more info)

I don't fully understand this, but here are some of the questions that seem pertinent:

Is it better to have the default rules in the database or as a file?
Should the default rules & rule sets be deletable or only able to be disabled?

avpaderno’s picture

I would put them in the database, like any other rules; I would like better to be deletable, so I can delete them when I don't need them anymore.
Actually, they are good like examples, but they don't do something really useful; they can be used to build a more complex rule, but that is all they can be used for.

bekasu’s picture

Why not do both?

1. Load the example to the database.
2. Allow the user to change or delete the example rule.

3. Provide another static file with installation which contains the example rule info
4. Provide a button (link) that will let the user put the rule back in if it has been deleted

Seems like that would let each side of this discussion accommodate their concerns.

fago’s picture

Status: Postponed (maintainer needs more info) » Active

>Is it better to have the default rules in the database or as a file?
Usually you have it in the file. But this is about a uncommon use case: Provide an example rule.

>Should the default rules & rule sets be deletable or only able to be disabled?
only able to be disabled

For this issue, I still think it's best to go with "custom rule" just inserted in the db.

fago’s picture

When doing so we have to to care for #300923: Export page should not present an empty list.

avpaderno’s picture

The issue about the export page is set as fixed. Do you mean it's not really fixed?

fago’s picture

It's fixed as long as the list can't be empty - when this issue changes this and it can be empty, it's not.. ;)

fago’s picture

Issue tags: +rules 1.0

kT

fago’s picture

Status: Active » Fixed

>For this issue, I still think it's best to go with "custom rule" just inserted in the db.

I've done so. When installing the rules admin module, the rules are inserted. For existing installations it's done by an update, which should also handle modified "old default rules" correctly. Please test.

Status: Fixed » Closed (fixed)
Issue tags: -rules 1.0

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