Hi,

I would like to use the views integration for displaying expiry dates. Unfortunatly, nothing from the Role Expire module is exposed to views. I tried to add fields, filters, relationships and searched for exposed data from this module, but I couldn't find anything. Maybe I'm doing something wrong.

Do you have any idea what I what I should try? Please advise.

Thx.

Comments

sharplesa’s picture

Status: Active » Needs review

Scipr,

Views should be working fine with role_expire. See "Sample test instructions" at http://drupal.org/node/915334#comment-4868216.

If that URL helps and views is actually working for you, please change the status to "fixed".

If that URL doesn't help, please provide step-by-step process you used to generate the failure. Don't forget to include your list of enabled modules.

Thanks

Scipr’s picture

StatusFileSize
new83.84 KB

So I followed your sample test instructions (which were about the same steps that I did before I posted this issue)

Step-by-step process:

1. Checking my module page and verify correct installation of views and role expire.
Views (& views UI): version 7.x-3.0-rc1 (permissions and settings checked)
Role Expire: version 7.x-1.0-beta2 (permissions checked)

2. Adding default role expiry duration to some roles (admin/people/permissions/roles/edit)

3. Assigning roles to some users, with some of them I changed the default duration with a specific duration (user/edit)

4. Verify that the users have granted their role and the expiry dates are showing on the profile page.

5. Create a new view of type 'Users'. Add Page. Display format: unformatted list of fields

6. Trying to add field "User: Role expiration date/time" and "User: Role expiration role". But these fields are not exposed to views.

I had the same problem with 7.x-1.0-beta1 of Role Expire. I updated the module tot beta2, ran the database update script and tried again. Still the fields are not exposed in views. I've added an attachment with a printscreen.

Thanks.

sharplesa’s picture

Assigned: Scipr » sharplesa
Category: support » bug
Priority: Minor » Major
Status: Needs review » Needs work

Scipr, thanks for the painstaking report. If I hadn't seen the screenshot, I wouldn't have believed it. I've been able to duplicate the problem, and I don't like what I'm seeing. Turns out I was using a dev version of Views from over a month ago. I was using dev because the rc1 version of Views wasn't working.

The rc1 version of Views is *still* not working (it hasn't changed since 2011-06-17, so that's no surprise). But now the current dev version of Views (2011-09-26) is also not working. (BTW, the Views UI has changed a lot in the new dev version. It looks more like the 6.x version of Views.)

So now I'm in the same boat as you. I'll have to do some research and figure out why it isn't working any more and then see if there's something we can do in role_expire to fix the issue you've uncovered.

I'm changing this from 'support request' to 'bug report' because it's not a user issue or an education issue. Something's broken somewhere. Also, I'm escalating this from minor to major, because this is important functionality.

sharplesa’s picture

Status: Needs work » Needs review
StatusFileSize
new1.68 KB

I've figured it out. The dev version of Views used to report that it is version 3.0. Now it reports that it's version 3.0-alpha1. The following patch will make role_expire work correctly with the current version of Views. If this patch gets tested and approved, we'll create a beta3 of role_expire. If you are unable to apply and test the patch here's a shortcut. Just edit the file role_expire.module. Around line 190, you have

return array('api' => '3.0');

Replace that with

return array('api' => '3.0-alpha1');

Role_expire should then work with both views-rc1 and views-dev.

Please report back here if this works for you.

@stewsnooze, the attached patch has some sophisticated smarts in role_expire_views_api(). Is it over the top? If you approve, I'll commit.

Scipr’s picture

Sharplesa, thank you for your answer and solution. Your shortcut works perfectly and fixes my issue.

Should I be worried when I upgrade to a new version of views that the views integration will not work again?

sharplesa’s picture

That's a good question. If my patch gets iimplemented, here's what will happen as Views gets updated:

1. If Views becomes version '3.0', it will work fine.
2. If Views becomes version '3.{anything}', it will work, but you'll have a warning message that this version of Views is untested. If you find that that version works fine, you could file an issue and we can update role_expire to say we're compatible with this new version of Views. FWIW, during the whole life of Views 2, the version number was always '2.0'. My suspicion is that will be the case with 3.0 as well.
3. If Views becomes version >3, it will not work, and you'll get an error message telling you to file an issue at the role_expire issue queue.

This stringent compatibility checking may be overkill. If there's a Views expert listening in on this issue and can advise that the level of integration we're doing with Views doesn't require such strict checking, then I'll gladly loosen the compatibility checks.

sharplesa’s picture

The patch at #1293846: Problem entering default expire time comment #10 addresses this, loosening the rule to 'any 3.x version' is OK.

matslats’s picture

You still need to add the views.inc to the info file so that the d7 registry can see it.
files[] = role_expire.views.inc
files[] = role_expire.rules.inc

stewsnooze’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev

I've committed those two lines to the info file. Could you give it a go and see if that fixes your issue?

stewsnooze’s picture

Status: Needs review » Postponed (maintainer needs more info)

This will be available in the next dev release

jsibley’s picture

Issue summary: View changes

Has there been any progress on this since 2012? Is "expiration date" supposed to be working in views now?

Thanks.

rcodina’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)
StatusFileSize
new33.17 KB

Test most recent version. Look for the fields on attached screenshot. If you find any problem, open a new issue. Thanks!

rcodina’s picture

Assigned: sharplesa » Unassigned