Hi,
I have a situation where the row order doesn't reflect the weights of the actions. A newly added action can't be put in its place. Editing and saving the weights doesn't help: the new action remains at the bottom, although the weights of each row reflect the correct order.
When disabling drag & drop, I see following actions and weights:
- Load a list of entity objects from a VBO View. [-20]
- Loop
- Add an incident to a field (action of Radioactivity module) [0]
- Add an incident to a field (again Radioactivity) [-18]
- Convert data type [-17]
- Calculate a value. [-15]
- Set a value. [-14]
- Convert data type. [-16]
The last action should be located right below the "Calculate data type [-17]" row.
The first time I recognized this error was after using the Devel "debug" action for several values. I was unable to reorder those actions and thought it might be a restriction of Devel.
It doesn't matter if I'm using drag & drop or edit the weights manually: both don't work.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | screen capture.jpg | 50.98 KB | bisonbleu |
| #11 | 1568870-vbo_rules_ui.patch | 1006 bytes | krlucas |
Comments
Comment #1
Anonymous (not verified) commentedI found a way around the issue: export the bad rule, edit the array (so the order is right) and then reimport it.
The original rule isn't overwritten yet. Drop me a note, if you want to have a look at the data or so.
PS: the imported version has the same issue
Comment #2
Anonymous (not verified) commentedI've been able to pinpoint the issue to the existence of a "Load a list of entity objects from a VBO View." action. On an affected installation, adding this action breaks the Rules UI. Removing this action heals it. Adding it again breaks the UI again.
I was not able to reliably reproduce it. On one system I could reproduce, on the other I couldn't. If you want to try yourself, follow these steps:
- create a new User view with a page
- add a VBO field
- create a new Rules action set component
- add a "Load a list of entity objects from a VBO View." action
- select the view created above (no matter what display)
- add another action (eg. output some text to the website)
- move the other action above the VBO action
- save the component
Comment #3
Anonymous (not verified) commentedComment #4
Anonymous (not verified) commentedWhen reordering and saving, it seems the weights of actions are saved, but the rule configuration isn't updated accordingly. Is this possible?
Comment #5
Anonymous (not verified) commentedAgain, sorry for spamming the issue queue. But there is one new effect to mention. I simply don't know, if it helps. So just posting and pointing at it...
Copying the affected rule is possible only by export and reimport (machine name renamed).
Afterwards it is not possible to rename the affected rules. I tried to rename them. The renaming in the surface seemed to succeed, but it wasn't stored: reloading the rule settings has shown the old name. Loading the rules list has shown the old name, too.
I then removed the VBO loading action. Afterwards the rule was healed, I could save it.
There might be some kind of validity check when storing the rule, making it fail. So I looked into the Watchdog-Log: no entry about this. The VBO action returns a list of values of a specific type (user in my case). Could it be there is type checking in place that fails?
Comment #6
Anonymous (not verified) commentedSettings and title adjusted. The UI is actually working, but the backend doesn't store changes nor does it point at a failure.
Comment #7
mitchell commentedSeems like it might be a bug in VBO and not Rules. Let's ask.
Comment #8
Anonymous (not verified) commentedAlthough it might be a bug in VBO, Rules shouldn't fail to store the configuration or at least provide a reason why it can't be stored.
Best workaround is to wrap the VBO loading actions in an action-set (component). This way only the action-set wrapper freezes (can't be stored, cloned etc.), but the calling rule isn't affected anymore and can be used as usual.
Comment #9
krlucas commentedI can confirm that this is an issue. The weight of VBO actions of "Load list of entity..." are not saved after dragging dropping in the Rules UI and saved.
I have not seen this behavior with any other modules' actions so does seem to be VBO specific.
Comment #10
krlucas commentedOk. So what seems to be happening is when VBO generates the list of Rules eligible Views in views_bulk_operations_views_list() it iterates over every enabled View and calls $view->build(). If the View is configured with a REQUIRED exposed filter, a form_set_error() is thrown which causes the Rules UI form to not validate.
Seems like the views_bulk_operations_views_list() should catch or clear form errors generated by view->build() or just skip Views with required exposed filters since they would be inherently ineligible.
Comment #11
krlucas commentedHere's a patch for the issue described in #10. Seems kludgy to stash and reset form errors but traversing the view object to figure out if it had any required, exposed filters seemed equally gross.
Just to re-iterate the issue is that adding any VBO "Load a list" to a Rule configuration would break the drag and drop Rules UI form IF the site has any enabled Views with required, exposed filters.
To re-create:
Create a View of any type, give it an exposed filter that's required.
Create a VBO View if one does not exist.
Create a Rule set or Rules component with some non VBO actions.
Add a "Load a list of entity objects" action. Try dragging and dropping the actions to change the weight. The form save should fail silently without the weights being updated.
Comment #12
bojanz commentedThis is the way to go.
Comment #13
TravisJohnston commentedI am having a similar problem, though mine has to do when I go to create an Action Set, and click Add Action and choose the "Load a list of entity..." (either one of the 2 that show) the "please wait" toggle starts spinning then nothing happens.
Looking at the console log I see this:
Uncaught TypeError: Cannot read property 'dateformat' of undefined
Source is from VM788 line 198 typeof Drupal.settings.better_exposed_filters.datepicker_options.dateformat !== 'undefined') {
I tried updating BEF, but that didn't work.
Comment #14
bisonbleu commentedI have the same issue as in #13. Rules freezes and the console shows the following error (screen capture is attached).
Tried to apply the patch in #11...
I had to apply it manually.
Nothing changes though i.e. Rules still freezes.
I've updated VBO, Rules and BEF to latest dev without success.
I'm stuck. Can anyone help?
(setting issue back to active.)
Comment #15
bisonbleu commentedUpdate#1
Time to eat & sleep.
I'll see tomorrow if all this still works after a night of sleep and all caches dispersed to oblivion : )
Comment #16
sebastixI've run into the same issue as seen in comment #13.
Uncaught TypeError: Cannot read property 'dateformat' of undefinedon this line:typeof Drupal.settings.better_exposed_filters.datepicker_options.dateformat !== 'undefined') { ... }It seems that the BEF (https://www.drupal.org/project/better_exposed_filters) module (7.x-3.0-beta4) is the cause of the error, because when not using this module, everything works as aspected.
I've managed to work around:
1. Make a component action set with a action which loads a VBO view (Load a list of entity objects from a VBO View.) on a Drupal project without the BEF module
2. Export this component
3. Import this component on a Drupal project with the BEF module enabled
4. Change the system name of the view you would like to load
My export / import code of the rule component
Comment #17
tomrogI've also run into the same problem as seen in comment #13. Comment #16 helped me solve my issue.
I needed to count VBO view results, so if anyone else have the same issue, let me help you:
Comment #18
TravisJohnston commentedAnyone else have any luck?
I tried removing BEF and setting everything back to basic and it still doesn't work..
Comment #19
TravisJohnston commentedI got this working finally. Was banging my head on the keyboard after changing all the BEF views and uninstalled the BEF module and it was still throwing the AJAX 503 general error anytime I chose one of the VBO load Rule actions.
Ended up going through and disabling one by one every view that used VBO and would try the Rule again in between.
Turned out one of my VBO views had a broken handler in it. I wasn't using it anyways so I deleted the view and then I was able to use VBO in Rules again!