I got the following error after enabling the module and going to admin-> people-> edit

Warning : array_merge() [function.array-merge]: Argument #1 is not an array dans _form_set_class() (ligne 3988 dans /www/includes/form.inc).
Warning : array_merge() [function.array-merge]: Argument #2 is not an array dans theme_checkboxes() (ligne 2974 dans /www/includes/form.inc).

Please help

Comments

prossel’s picture

Got the same problem. Also on 7.4.
Module turns out to be unusable so far.
I also have the following notices when saving a user:

Notice : Undefined variable: op dans role_expire_user_presave() (ligne 331 dans (...)/sites/all/modules/role_expire/role_expire.module).
Notice : Undefined variable: op dans role_expire_user_presave() (ligne 331 dans (...)/sites/all/modules/role_expire/role_expire.module).
Notice : Undefined variable: op dans role_expire_user_presave() (ligne 331 dans (...)/sites/all/modules/role_expire/role_expire.module).
Notice : Undefined variable: op dans role_expire_user_presave() (ligne 331 dans (...)/sites/all/modules/role_expire/role_expire.module).
stewsnooze’s picture

I agree. See this URL for the "release notes"

http://drupal.org/node/1209456

All I did was push to git to start the ball rolling. Also hoping that others might create a sandbox project branch or github clone to help get it ready for 7.

prossel’s picture

StatusFileSize
new11.91 KB

I managed to make user edit form and user view work for D7.
Here is my first Drupal patch. It is based on 7.x-1.x
I hope everything is OK and it will be useful.

stewsnooze’s picture

Status: Active » Needs work

@prossel thanks so much for the patch. Unfortunately it fails to apply cleanly. I'll paste the output here

$ git apply user-edit-form-1214164-3_0_0.patch 
user-edit-form-1214164-3_0_0.patch:46: trailing whitespace.
      if ($(this).attr("checked")) {  
user-edit-form-1214164-3_0_0.patch:58: trailing whitespace.
      } 
user-edit-form-1214164-3_0_0.patch:60: trailing whitespace.
        $('#'+textfieldId).parent().hide(200);    
user-edit-form-1214164-3_0_0.patch:174: trailing whitespace.
    
user-edit-form-1214164-3_0_0.patch:197: trailing whitespace.
  
warning: squelched 4 whitespace errors
warning: 9 lines add whitespace errors.

prossel’s picture

StatusFileSize
new11.88 KB

(edit: don't know what's wrong, could not upload patch correctly first time by replying to #4)

prossel’s picture

(double post)

prossel’s picture

StatusFileSize
new11.88 KB

Sorry for the trailing spaces. I was in a hurry and didn't take the time to verify my patch.

Here is a new version that should work smoothly.

joemaine’s picture

I applied the patch but receive the following when cron is run:

Fatal error: Cannot use object of type stdClass as array in /........../public_html/sites/all/modules/role_expire/role_expire.module on line 420

aside from the error...the module looks very promising. I wonder if this might be a candidate to join Drupal Commerce (in replacement of Role Reference and Commerce Subscription). Usings Rules is the easiest way to create a role on a purchase...and this module can remove the role.

sharplesa’s picture

Nice. I wish I'd seen this before I spent all day Saturday doing the same thing(!). Your work is more complete than what I did.

1. Do you think you'll be able to address joemaine's cron problem in comment #8 by Monday? If so, I'll wait. Otherwise, I'd be glad to roll a patch with the cron fix in it.

2. The format of the date string as rendered in the role_expire text field needs attention.

3. The code comments need attention. E.g., a few "TODO Please review the conversion..." comments need to be deleted since those D7 queries are correct. Also, a few of the function headers are wrong.

4. Should get rid of "function role_expire_user_XXX".

sharplesa’s picture

5. function role_expire_form_user_admin_role_alter (triggered by admin/people/permissions/roles/edit/#)
a. #title: "Default day length for the role %role" should be something like "Default duration for the role %role".
b. #description: How about changing "Leave blank for no default length. Values should indicate the number of days the role should be active for." to something like "Default number of days this role should be active. Leave blank for no limit."

stewsnooze’s picture

Those text changes would be fine by me

joemaine’s picture

Hi sharplesa,

If you're looking for another text change....

Line 389 (after patch from #7)
- $roles[$key] = t("%role role - expires on %timedate", array('%role' => ucfirst($val), '%timedate' => format_date($expiry_roles[$key])));
+ $roles[$key] = t("%role role expiration: %timedate", array('%role' => ucfirst($val), '%timedate' => format_date($expiry_roles[$key])));

...this will solve a tense display issue for expired roles.

The cron error I posted earlier appears at the footer of every page.

BenK’s picture

Great to see progress on this... subscribing and can help with testing.

--Ben

joemaine’s picture

Any work on the cron issue?

Would it be better to use hook_cron_queue_info instead of hook_cron?

sharplesa’s picture

It's an easy fix. I've got it running on my machine. Will have the patch for you to try on by the end of the day.

sharplesa’s picture

Posted a patch at http://drupal.org/node/915334#comment-4779172. Suggest closing this bug as a duplicate of 915334. What do you think?

stewsnooze’s picture

Are you going to close this. The patch in 915334 just went in or is there still a problem here for you?

stewsnooze’s picture

Status: Needs work » Closed (duplicate)