Pimcore: [Bug] When removing a langage, corresponding sql views are not removed.

Created on 13 Jun 2019  路  4Comments  路  Source: pimcore/pimcore

Hello,

When a language is removed in the GUI Pimcore (system settings), the corresponding object SQL views are kept.
Problem occurs if a field is removed from a class. The object SQL view for the no more configured langage is not updated and try to get the old column which doesn't exist anymore.
As one of the consequence for instance, the database could no more be exported (myssql send an error because the SQL view call an unexisting column).

How to reproduce:

  • set 2 languages in system config
  • create a class with at least two attributes
  • first, remove one of the language
  • then, remove one of the attribut
    Try an SQL dump (or just click on the view object_query_ on adminer it will send an sql error)

Thanks.

Bug Prio-Backlog

Most helpful comment

Automatic deletion would be very dangerous. It sometimes happens that someone overwrites the system settings unintentional (this could happen very easily). Therefore I think we should not use a fully automatic approach...

All 4 comments

@brush @dvesh3 Thanks for this new command!
Maybe this command should be runned when saving the system settings in the GUI to ensure database keep consistency without manual intervention ? (and could be runned during maintenance script too)

Automatic deletion would be very dangerous. It sometimes happens that someone overwrites the system settings unintentional (this could happen very easily). Therefore I think we should not use a fully automatic approach...

From version 6.0, you can now override and change system configuration in system.yml manually. so to keep the changes consistent, we kicked the functionality to remove localized tables/views from GUI save action. Also, we'd like to give user full control over this and can still setup cron for this command for automatic cleanup.

I understand perfectly this precaution. It is ok, as i have seen you added directly a note in the GUI so we don't forget it ! (delete_language_note)
Thanks.

Was this page helpful?
0 / 5 - 0 ratings