- π¨π¦Canada joseph.olstad
@All,
I was able to figure out how to get the rules_user_fields module to retrieve custom fields from the 'Actions' however after following all the available threads on stack exchange and drupal.org I was unable to figure out how to do this from the 'Conditions' for a data comparison.
In the Actions I had to create a variable from the retrieved value of the fetched entity and set it as an integer
However I haven't found a way to access custom fields from a user entity in the 'Conditions'
The rules_user_fields module functionality appears to only be available from the 'Actions'. If I figure this out I'll update this thread.
- πΊπΈUnited States arlingtonvoicellc
In case anyone is interested, I resolved this issue by switching to the ECA module, which appears to be better maintained and with more robust features than rules. Highly recommend making the switch.
- π¨π¦Canada joseph.olstad
@arlingtonvoicellc, ECA looks like a very interesting project and is progressing rapidly. With that said, rules is mature, has far more existing installations and supports PHP 8.0. The latest ECA requires a minimum PHP 8.1 and is going through intense development.
- πΊπΈUnited States arlingtonvoicellc
The most current version of Rules is still in an "Alpha" release state, while ECA has a stable release for the most current version of Drupal. So your characterization of "intense development" could easily be cast back at Rules for still being in Alpha state all these years later. Support for Rules is largely dead and left to each individual to figure out, without waiting months for a ping from the community. ECA has a stable release for the current version of Drupal and has a very active developer community that rapidly responds to tickets. I'd imagine most of the rules installations are attributed to Drupal 7 websites. Rules worked on Drupal 7. I don't know why so much changed with Drupal 8, but it doesn't work like it did. ECA is an incredibly robust module that does everything Rules should do plus more. I'd encourage anybody to give it a shot with the expectation of phasing out Rules.
- Status changed to Closed: outdated
over 1 year ago 3:30am 5 April 2023 - Status changed to Active
over 1 year ago 6:42pm 5 April 2023 - πΊπΈUnited States arlingtonvoicellc
Stating the truth is not "false statements" and "hateful speech." Not knowing the background of the rift, I'd guess your attitude is probably why some devs jumped ship and started ECA. On the contrary, a post in the ECA forum is met with enthusiasm and a helpful attitude. Have a fair day. Good luck with rules. I have abandoned using it. I have nothing more to add here.
- π¨π¦Canada joseph.olstad
We've had success in this use case with a custom user field:
Commerce module
Auction module that integrates with commerce
Rules module
rules_user_fields moduleCustom user field called "bids remaining" of type "float/integer/text" .
For every auction bid placed, I've configured rules to decrement the remaining bids field.
Every time a bid is saved, we have configured a rule to load the user entity by the user associated with the bid and then access the user field value in the actions.
In the actions I'm able to load the user field using the rules_user_fields module when this module is installed.
This works as I've configured it, so for the moment I don't require the user field to be available in the conditions although that would be great if it was available.
Basically the bids remaining is decremented by the actions we added to the rules configuration. It's working.
We could have done all this in a bid presave hook or some other bid event with custom PHP but decided to try out rules and did manage to figure it out for learning purposes.
Very cool module, thanks @TR