Needs work
Project:
Rules
Version:
8.x-3.x-dev
Component:
Scheduler
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2011 at 11:26 UTC
Updated:
12 Feb 2019 at 07:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
itangalo commentedAttached patch adds this functionality in the following way (see also attached screenshots):
* Every entity parameter in every Rules component becomes available as a Views field.
* Each field can be set to display entity ID, entity label, entity bundle or entity type.
Comment #2
itangalo commentedComment #3
fndtn357 commented#1: 1319538-1-field_handlers_for_parameters.patch queued for re-testing.
Comment #4
fagointeresting approach. I'm not sure about going this way though. First off, it's really not the usual way Views works. Second, once we go that route people 'll want relationships and stuff like that. So let's better not open that can of worms....
Maybe though, I'd be a good idea to work upon an improved storage for that data. I.e. have a table that has entries like 'data_type', 'value'. That should even make relationships possible + should be much easier to port to future rules versions as there are no special classes serialized...
Note that a bit problematic are data structures being no entities and having no id - we'd still have to store them serialized.
I wonder what klausi thinks about that idea.
Comment #5
itangalo commentedThanks for the comments! I'll keep the worm can closed for now. :-)
Comment #6
klausiFago and I talked about this: to do a proper Views support we should move the parameters of scheduled tasks to a separate table (e.g. rules_scheduler_param). We should focus on entity parameters as they are most likely a use case here (e.g. list all scheduled tasks for a node, for a user etc.). So the colums of such a table would be:
task id
param name
param type
entity id (integer, only set if the param type is an entity)
param value (serialized, only set if the param type is not an entity)
We use 2 columns for the value here because we want to index the entity id column for fast access for our actual use case. Another advantage of this approach is that we do not have serialized entity wrapper classes in the DB anymore, which eases the upgrade path to Drupal 8 where the wrappers will not exist anymore.
Comment #7
itangalo commentedThis sounds cool. It would be awesome to be able to access this information – as you say, listing upcoming scheduled tasks for a node definately makes sense.
Comment #8
klausiUnassigning myself as I currently don't have time to work on this ... Itangalo do you want to take a stab at this?
Comment #9
itangalo commentedI'm going into a hectic phase now, which will probably last until Christmas. I'll keep an eye on this, but I can't promis anything. Sorry.
Comment #10
wodenx commentedHad a need for this myself, and implemented part of #6. Had to do it very quickly, so the parameters are still serialized in the rules_scheduler table, but now there is also a rules_scheduler_params table which is exposed to views. Relationships are also still to do, but this lays the groundwork, I think, and includes sort/filter handlers.
Comment #11
SharonD214@aol.com commentedI'm trying to use your patch for the Learn the Rules framework screencast ( Which is great!) but I'm having problems setting up the view for scheduling front page content. When I try to add the Rules parameter: Node (node)
Data from the parameter called Node (of type node), used in component rules_publish_on_front_page. - to my table I get a missing handler error.
Any ideas?
Thanks
Sharon
Comment #12
itangalo commentedSharon: No, sorry. It was too long since I made this, so I don't remember. And probably the code has changed quite a bit. :-/
Comment #13
SharonD214@aol.com commentedok -
It was worth as shot, Thanks anyway!
Sharon
Comment #14
f2boot commentedI have spent some time upgrading this patch, expending on the relationship side.
I have also registered rules scheduler task as an entity in order to use it with VBO (Views Bulk Operations)
I did my best by please review thoroughly
Comment #16
f2boot commentedCorrected patch for incorrect filepath...
Comment #17
f2boot commentedComment #18
f2boot commentedComment #19
f2boot commentedLast try, hope it is the good one
With apologies for those who follow this issue and have polluted mailbox because of me...
Comment #20
tr commentedMoving to 8.x-3.x.