unikent / programmes-plant

A comprehensive solution for the management of university programmes, that produces an XCRI feed.
Other
7 stars 4 forks source link

Cannot edit a leaflet #98

Closed gnozu closed 11 years ago

gnozu commented 11 years ago

On the leaflet edit page you can't actually edit a leaflet without changing its name.

conatus commented 11 years ago

This is because the Leaflet is checking for a unique name, when it shouldn't be when editing.

conatus commented 11 years ago

https://github.com/unikent/programmes-plant/blob/master/application/controllers/leaflets.php#L42

This adds the rule about ID being unique and already existing but doesn't remove the rule that it should be a unique name that should not exist inherited from the model rules. https://github.com/unikent/programmes-plant/blob/master/application/models/leaflet.php#L5

This may be a problem upstream in the SimpleAdmin Controller (a hence all inheriting models) as this does roughly the same. https://github.com/unikent/programmes-plant/blob/master/application/controllers/simpleadmin.php#L96

Quick fix though - just add another rule below this line telling it not to worry about stuff in name - and its done (with a regression test - of course!).

thybag commented 11 years ago

This is now solved in: https://github.com/unikent/programmes-plant/pull/106 (campuses had custom code and wasn't inherit the simpledata methods like the other forms, it should now be refactored to be normal)