There seems to be a repeating issue where people are finding the conditions and/or actions select widget empty. This can be caused by not having any of the included modules installed so no conditions or actions are available.

We need to add a warning message when no conditions or actions are available so users don't get confused.

CommentFileSizeAuthor
#5 uc_discounts_status_messages.patch1.65 KBjoachim

Comments

joachim’s picture

Simplest thing is to implement hook_store_status.
A warning when users actually are on the page with the empty bits, or when users are at the start of the process of adding a discount would be good too -- since there's no point creating a discount if you have less than 1 condition and 1 action available.

psynaptic’s picture

I would say the most visible place for a warning would be on the discounts admin page itself. We could have a message on the install page too since that would save the admin navigating back to the modules page.

joachim’s picture

Title: Add warning when no conditions and/or actions are available » Conditions and/or actions select widget is empty

/admin/store/discounts ?

Yup, since that's where you start trying to add discounts.
Still, it's not too hard to also do a status notice.

So we need to code:
- a sanity-checking function for the core discounts module. This checks there is at least one action and one condition available; returns TRUE or FALSE.
- something that calls this on the discounts admin page. Ideally, this should block the 'add discount' link too, since it's of no use.
- an implementation of hook_store_status which calls this too.

psynaptic’s picture

Title: Conditions and/or actions select widget is empty » Add warning when no conditions and/or actions are available
joachim’s picture

Title: Conditions and/or actions select widget is empty » Add warning when no conditions and/or actions are available
Status: Active » Fixed
StatusFileSize
new1.65 KB

Turns out there's already functions that get a list of actions and conditions: they're used to populate those lists that are showing up empty.
Implemented the hook, and checking on our admin page too with a message that sends the user to check status.
Here's a patch of what I've committed.

psynaptic’s picture

Just tested this and it works perfectly. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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