-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argument 1 passed to rules_config_delete() must be of the type array, object given #89
Comments
@herbdool Yes, I've just been added as a co-maintainer and working towards a new release soon after some clean up. |
There's a name collision going on here. Configuration Manager defines But in the Rules module, we have this:
So So, I think we need to rename at least that function (maybe others for consistency?). |
Ugh. (Good thing Laryn is a co-maintainer of both Rules and Ubercart.) |
Well...I see no alternative but to rename the function Perhaps And then that means that those calls in Ubercart will need to be updated to use the new name. And so when the new version of Rules is released, there will need to be a Rules-version-dependent release of Ubercart to keep them in sync. |
This function was already removed from Rules. I don't know if @laryn has made a new release yet. With the move to CMI I don't know if it's necessary in Ubercart either. |
@herbdool, this function has nothing to do with CMI. The |
Also, the functionality does seem to be needed by Ubercart. Here, for example, is a function from the uc_taxes module:
Note that this is deleting any tax |
And reading through the discussion of #47, I think the function should not have been removed, just renamed (with corresponding changes in Ubercart). Looks like it was removed in PR #80 on 3/17/21, but, like the cat, it came back. It's currently in the 1.x-2.x branch and git blame says it's been there for the past 12 years. |
Yeah I get that it had a different purpose - I know it didn't do anything with CMI. Perhaps it's time to convert the configuration storage for Rules from the db to CMI, though. There's an issue on the backlog for that. |
Yeah, I see that's #69. I see the discussion of the issue in #25 (although that dealt only with import/export). I'm far from an expert in this, but it strikes me that converting the Rules module to store all individual rules in CMI and provide the hooks and CRUD interface to other modules that work with Rules (like Ubercart) would be a pretty big task, much larger than just the import/export capability. But I'd like to get @laryn's thoughts, since Rules is currently his baby. And, getting back to this issue: since (Incidentally, a workaround for anyone who encounters this problem while trying to do a config import is to manually delete any config files listed as "to be removed" from the active config directory prior to running config sync. Not a great solution, since any side effects of config removal won't happen, but it can at least get you past the error.) |
I may have brought this cat back to life when I merged from upstream to try to get things all up to date. I haven't thought through all the implications of moving to CMI -- my immediate goal has been to try to get this functional and up to date as is. I'd love for the tests to all be passing before we make a new release. @bugfolder you may honestly have your head around things much better than me at the moment. No pressure, but do you want to team up on Rules as well (as we've done for Ubercart). I'd be happy to add you as a co-maintainer. |
I've worked on converting Feed's configuration from the db to CMI so I think it's fairly doable here too. The meat of the configuration functionality is here: https://github.com/backdrop-contrib/rules/blob/1.x-2.x/includes/rules.core.inc. I think it's fairly well extracted so that's good news. Instead of having to query relations between different tables, each rule could be stored as a nested array in its own config file. |
@herbdool The offer to comaintain stands for you, too, if interested. ;) |
I'm holding off from co-maintaining but if I've got time I can see about converting to CMI. |
@laryn, I'd be happy to join as co-maintainer. Rules feels like it's practically a part of Ubercart (of course it's more; it's got 277 installs, vs UC's 61). But the same warning as when I joined UC: the things I file PRs on, I'm pretty comfortable with, but there's vast swaths that I'm not comfortable with (at least not yet), and the whole entity system is one of those things! (Someday...) That said, I'm quite positive on the notion of converting Rules wholly to CMI. It feels a lot like Views in that regard. As the issue discussion noted, it would be way nicer to distribute rule sets as collections of JSON files versus implementations of I would also welcome getting the automated tests to work, but that's way out of my expertise right now. I do observe that the same functional tests are failing for Rules and UC related to |
Circling back to the original purpose of this issue, it looks like renaming |
I bumped into this trying to help fix Ubercart tests. Ubercart is very tightly integrated with Rules, so this kind of issues mess up many things there. I agree that a first necessary step is to rename Switching the storage of Incidentally, several ported contrib modules present the same problem. For example webform stores its configuration entities in database (see backdrop-contrib/webform#192). Also even Entity Plus, which has the ability to create configuration entities (those who define bundles of custom entities), still stores those in the database. So, a general overhaul of those is needed at some point, but since the db storage causes no harm, I don't see a rush to do that. |
Here's the corresponding Ubercart issue: backdrop-contrib/ubercart#305. |
@bugfolder, There are a few things to keep in mind: Most importantly: So, that means that the hooks being called are STILL named The only way around this is to rename the entity type to |
I get this error:
I was importing some configuration. But I'm not quite sure why since rules are not yet in config.
The text was updated successfully, but these errors were encountered: