-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Short description of the issue
Renaming a field with a capitalized name that already exists in lowercase destroys the table and all data for the field you are renaming. The field that was being renamed is continues to exist under it's previous name within ProcessWire but now shows an error that its corresponding database table does not exist. First noticed in a site running v3.0.165, confirmed issue still exists in v3.0.200. Possibly affects all versions of ProcessWire.
Expected behavior
Renaming a field with a capitalized name that already exists in lowercase is recognized as unique and saves properly.
Actual behavior
Renaming a field with a capitalized name that already exists in lowercase deletes the table for the field being renamed and SQLSTATE[42S02] Base table or view not found
error is shown in the admin. The field retains the original name and remains present in ProcessWire and assigned to templates.
Optional: Screenshots/Links that demonstrate the issue
Optional: Suggestion for a possible fix
Enable case-sensitivity for field names or detect field name similarity and show an error without data loss.
Steps to reproduce the issue
- Create a field with the name
body
- Create a field with the name
wvprofile_body
- Rename the field
wvprofile_body
toBody
Setup/Environment
- ProcessWire version: 3.0.165
- (Optional) PHP version: 8.0.27
- (Optional) MySQL version: 5.7.41-log
- (Optional) Any 3rd party modules that are installed and could be related to the issue: Isolated core issue