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:

  1. String roles as role names instead of role IDs.
  2. 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_id dropped in favor of new name.
  • The field rids dropped in favor of new roles.

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?

Comments

manojbisht_drupal’s picture

Issue summary: View changes

Hello,

Did u get the solution for it

Kristina Katalinic’s picture

@manojbisht_drupal Unfortunately no...

Leeteq’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Category: Bug report » Feature request
Priority: Normal » Major

This is important, but not a bug. Moving to Feature requests.

Leeteq’s picture

If the maintainer agrees that this is needed functionality, then better move it to Tasks, actually.

manojbisht_drupal’s picture

StatusFileSize
new1003 bytes

Hello All,

I have created a patch for it.

Please check it at your end. In my System it is working fine.

claudiu.cristea’s picture

Title: Features Integration » Features Integration for Automatic role assignment component
Issue summary: View changes
claudiu.cristea’s picture

Assigned: Unassigned » claudiu.cristea
claudiu.cristea’s picture

Status: Active » Needs review
StatusFileSize
new6.56 KB

Here'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.

claudiu.cristea’s picture

Assigned: claudiu.cristea » Unassigned

Status: Needs review » Needs work

The last submitted patch, 8: features_integration-2045659-8.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new545 bytes
new6.56 KB

Oops!

mike.davis’s picture

Thanks 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.

claudiu.cristea’s picture

@mike.davis, then let's RTBC this :)

claudiu.cristea’s picture

Title: Features Integration for Automatic role assignment component » Featurify
Issue summary: View changes
mike.davis’s picture

@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.

claudiu.cristea’s picture

Issue summary: View changes
StatusFileSize
new26.94 KB
new29.78 KB

OK. This patch covers the whole module. Now everything is exportable with features including the pages.

Status: Needs review » Needs work

The last submitted patch, 16: featurify-2045659-16.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 16: featurify-2045659-16.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new31.2 KB
new1.78 KB

I don't understand the failure.

Status: Needs review » Needs work

The last submitted patch, 20: featurify-2045659-20.patch, failed testing.

mike.davis’s picture

Looks 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:

Argument 1 passed to DrupalWebTestCase::drupalLogin() must be an instance of stdClass, boolean given, called in /var/lib/drupaltestbot/sites/default/files/checkout/sites/default/modules/autoassignrole/autoassignrole.test on line 42 and defined

claudiu.cristea’s picture

The tests are failing when enabling the module.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new26.54 KB

hm

Status: Needs review » Needs work

The last submitted patch, 24: featurify-2045659-24.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new29.38 KB

wrong diff

claudiu.cristea’s picture

StatusFileSize
new1.83 KB
new30.91 KB

Let's try with the 'dependencies' option in ::getInfo().

Status: Needs review » Needs work

The last submitted patch, 27: featurify-2045659-27.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new445 bytes
new31.21 KB

Forgot one test.

Status: Needs review » Needs work

The last submitted patch, 29: featurify-2045659-29.patch, failed testing.

The last submitted patch, 29: featurify-2045659-29.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new31.22 KB
new415 bytes

Now I got:

run-tests.sh reported no tests were found. See review log for details.

And this I really cannot understand.

Status: Needs review » Needs work

The last submitted patch, 32: featurify-2045659-32.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Postponed

OK. So I understand now after @Berdir explained me this failure on IRC. Here's the transcript:

claudiu_cristea: Hi all. Can somebody help me understand this testbot failure? https://qa.drupal.org/pifr/test/1093183
berdir: claudiu_cristea: missing dependencies
berdir: claudiu_cristea: testbot can't handle new dependencies in a patch
berdir: claudiu_cristea: the dependency needs to be added in a separate commit first and then it needs some time to rebuild and learn about that
claudiu_cristea: berdir: thank you so much. so, you mean, that the patch needs to be commited first even it fails with that?
berdir: claudiu_cristea: not that patch. just a one line patch that adds the dependencies line to the info fail
berdir: claudiu_cristea: then wait a day or so until there's a new dev release and testbot rebuilds the dependencies
berdir: claudiu_cristea: info fail = info file 
claudiu_cristea: berdir: I see. Thank you 

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[] = ctools line addition and cleanup of unneeded lines.

mike.davis’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Postponed » Needs review

After 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.

Status: Needs review » Needs work

The last submitted patch, 32: featurify-2045659-32.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new38.78 KB
new20.14 KB

Patch. Let's see if the dependency has been propagated.

claudiu.cristea’s picture

We have a green patch here :)

claudiu.cristea’s picture

StatusFileSize
new38.79 KB
new429 bytes

Small change.

claudiu.cristea’s picture

Is there a chance to have this committed in 7.x-2.x?

mike.davis’s picture

I 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.