Bonfire
Bonfire copied to clipboard
Re:Ticket #629, Fixed Module name too short in Controller/View for permissions
A quick fix to allow permission names to be the full 100 characters specified in the ticket.
As an aside, why does the controller re-specify validation rules when the correct rules already exist in the model?
The answer to why the controller re-specifies the rules is most likely that the model was updated to include the rules but one or more references to the model was not. So, the controller can be updated to use:
$this->form_validation->set_rules($this->permission_model->get_validation_rules($type));
Then the view just has to be modified to allow 255 characters for the name field.
Actually, now that I look back at the original issue, changing the maximum length of the name in the form will just make the problem worse. The reported issue is caused by the generated description being longer than the description field permits, in part because the generated description includes the name.
...and looking into it further, the permission form should have no effect on the original issue, which is strictly related to the form in the module builder, since the descriptions of the permissions are generated by the builder, rather than input in the form.