Problem/Motivation
Because the roles are stored as rid in the backend the export is not functioning, Also the custom storage of pages {autoassignrole_page} is not handled via CTools export making this impossible to be exported.
Proposed resolution
Make the module exportable with features by:
- String roles as role names instead of role IDs.
- Add CTools as dependency and make the table
{autoassignrole_page}exportable.
Remaining tasks
None
User interface changes
On the page administrative form the site builder needs to enter also a machine name for the page.
API changes
Depends on Chaos Tools Suite (ctools).
Data model changes
Variables autoassignrole_auto_roles and autoassignrole_user_roles are storing now role names instead of role IDs.
The table {autoassignrole_page} has a different structure:
- The field
rid_page_iddropped in favor of newname. - The field
ridsdropped in favor of newroles.
Original post by @Kristina Katalinic
Hi,
this is a very handy module and I like what it does but, I just discovered a shortfall: Doesn't play nice with features.
Whilst I was able to strongarm auto assign role settings I also received a following error:
Warning: Invalid argument supplied for foreach() in features_override_module_component_overrides() (line 201 of /sites/directory.dev/sites/all/modules/features_override/features_override.export.inc).
Any solutions?
| Comment | File | Size | Author |
|---|---|---|---|
| #40 | interdif.txt | 429 bytes | claudiu.cristea |
| #40 | featurify-2045659-40.patch | 38.79 KB | claudiu.cristea |
| #38 | interdiff.txt | 20.14 KB | claudiu.cristea |
Comments
Comment #1
manojbisht_drupal commentedHello,
Did u get the solution for it
Comment #2
Kristina Katalinic commented@manojbisht_drupal Unfortunately no...
Comment #3
Leeteq commentedThis is important, but not a bug. Moving to Feature requests.
Comment #4
Leeteq commentedIf the maintainer agrees that this is needed functionality, then better move it to Tasks, actually.
Comment #5
manojbisht_drupal commentedHello All,
I have created a patch for it.
Please check it at your end. In my System it is working fine.
Comment #6
claudiu.cristeaComment #7
claudiu.cristeaComment #8
claudiu.cristeaHere's a patch. As is stated in the issue title and summary this covers ONLY the Automatic role assignment. Please don't block this patch only because it don't contain all the "Features Integration" functionality. My advice is to treat the other 2 components as separate issues, making them more reviewable. I don't need them right now and I don't have time to work them but I'm OK to provide a review if somebody wants to create them.
Comment #9
claudiu.cristeaComment #11
claudiu.cristeaOops!
Comment #12
mike.davis commentedThanks Claudiu. I think it makes a good move towards enabling feature integration.
With this as a starting ground I think it will make for updating the user choice and per role page settings.
Comment #13
claudiu.cristea@mike.davis, then let's RTBC this :)
Comment #14
claudiu.cristeaComment #15
mike.davis commented@claudiu.cristea, I have currently only had a look through the patch and had a quick check with Features but I haven't been able to test it fully yet by creating a feature and applying it to another site.
If someone else has a chance to check that the created feature creates the right settings then I'd be happy to RTFC. Otherwise I will try and have a check of it with the Features module when I get a chance.
Comment #16
claudiu.cristeaOK. This patch covers the whole module. Now everything is exportable with features including the pages.
Comment #20
claudiu.cristeaI don't understand the failure.
Comment #22
mike.davis commentedLooks like something isn't right with the user logging in, which seems to occur on all the tests, which is causing them to all fail:
Comment #23
claudiu.cristeaThe tests are failing when enabling the module.
Comment #24
claudiu.cristeahm
Comment #26
claudiu.cristeawrong diff
Comment #27
claudiu.cristeaLet's try with the 'dependencies' option in
::getInfo().Comment #29
claudiu.cristeaForgot one test.
Comment #32
claudiu.cristeaNow I got:
run-tests.sh reported no tests were found. See review log for details.And this I really cannot understand.
Comment #34
claudiu.cristeaOK. So I understand now after @Berdir explained me this failure on IRC. Here's the transcript:
So, you'll need to commit first #2531402: Make the module dependent on ctools event is red (that is expected). Postponing this till #2531402: Make the module dependent on ctools goes in. That contains only
dependencies[] = ctoolsline addition and cleanup of unneeded lines.Comment #35
mike.davis commentedAfter applying the patch from #2531402: Make the module dependent on ctools to a 7.x-2.x branch I have updated this to be related to this new dev branch, so hopefully the test should now work for this patch.
Comment #38
claudiu.cristeaPatch. Let's see if the dependency has been propagated.
Comment #39
claudiu.cristeaWe have a green patch here :)
Comment #40
claudiu.cristeaSmall change.
Comment #41
claudiu.cristeaIs there a chance to have this committed in 7.x-2.x?
Comment #42
mike.davis commentedI have tried applying this patch, but there were a few patching offset errors - I expect due to the addition of the admin stats from #971614: Introduce states to auto admin settings page.
However, it seems to have added everything from initial glance, so I will commit this shortly for further testing.