When i click the register tab i receive this error. The manage registrations tab seems to work fine.

Recoverable fatal error: Object of class RegistrationState could not be converted to string in DatabaseStatementBase->execute()

Comments

hyperidler’s picture

I'm running Drupal 7.36 and encountered this same message after I started enabling the various registration states (Complete, Pending, Held, Cancelled).

After some trial and error I found that if I uncheck the "Held" column for all states the error went away. Basically, if you check any state with the "Held" column you will get this error.

I am not sure what function this column serves, but if I leave it unchecked I can see all of the options listed above for my registrations.

manuel garcia’s picture

Yup, confirming this issue, ran into this while evaluating the module.
I think it's happening if you have both active and held checked on the state that the registration is going to go into.

This type of configuration could not make much sense perhaps, but the fatal error should be prevented.

caxy4’s picture

Status: Active » Closed (fixed)

Thanks for the bug report @hyperidler and a recipe for reproducing the issue @Maluel Garcia

I've fixed the issue by adding validation to the registration state form with commit 64b5fa7

manuel garcia’s picture

Hey thanks for the swift response / fix caxy4!

hawkbreeze’s picture

Hi can I just make a comment here in that I think the words "pending" and "held" are being referred to as the same thing which I think is confusing. I've noticed this starting to creep into the module.

The confusion is that a Pending state (A registration state that has a label called pending) can be an Active or Held state.

Even in this patch the test is;

if ($state['active'] && $state['held']) {
      form_set_error('state', 'A state can only be "active" or "pending" – not both. Update the "' . $state['label'] . '" state to resolve this warning.');
}

It tests for active or held states not "pending". So I think the wording should be "A state can only be "active" or "held" – not both. Update the "' . $state['label'] . '" state to resolve this warning"

This might seem trivial but using the word pending when referring to held is confusing and inconsistent.

Thanks

manuel garcia’s picture

Thanks @cannod for the input!
I'm thinking the way forward would be to open a follow up issue, with your thoughts and the proposed solution, agree?

caxy4’s picture

I've incorporated the error text update @cannod suggested in their last comment: df04198

manuel garcia’s picture

good stuff, thanks again!