Closed gnozu closed 11 years ago
This is because the Leaflet is checking for a unique name, when it shouldn't be when editing.
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!).
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)
On the leaflet edit page you can't actually edit a leaflet without changing its name.