Commit 3013fe57b23c21220cbbbd5037c7ec95802101a2
1 parent
e228e637
KTS-4124 MySQL doesn't distinguish between é and e, added an additional check in PHP.
"It is impossible to rename the Fieldset name form 'Fielde' to 'Fieldé'" Fixed. Committed by: Megan Watson Reviewed by: Kevin Cyster
Showing
1 changed file
with
4 additions
and
1 deletions
plugins/ktcore/admin/documentFieldsv2.php
| ... | ... | @@ -402,9 +402,12 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { |
| 402 | 402 | $data = $res['results']; |
| 403 | 403 | $errors = $res['errors']; |
| 404 | 404 | $extra_errors = array(); |
| 405 | + | |
| 406 | + // check that the fieldset name either hasn't changed, or doesn't exist. | |
| 405 | 407 | if ($data['name'] != $this->oFieldset->getName()) { |
| 406 | 408 | $oOldFieldset = KTFieldset::getByName($data['name']); |
| 407 | - if (!PEAR::isError($oOldFieldset)) { | |
| 409 | + // If the fieldset exists throw an error. Mysql doesn't distinguish between Ž and e so check the names are different in php. | |
| 410 | + if (!PEAR::isError($oOldFieldset) && $oOldFieldset->getName() == $data['name']) { | |
| 408 | 411 | $extra_errors['name'][] = _kt("A fieldset with that name already exists."); |
| 409 | 412 | } |
| 410 | 413 | } | ... | ... |