You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see here, there is an "onUpdate" function in the Media model. It is executed on the doctrine event "PostUpdate", so after a media object is updated. If the name of the media object was changed, this function renames the file of the media and then it updates the "path" attribute. But this new "path" attribute is never saved to the database, because the media object was already saved (PostUpdate). So when you update the name of a media object and save this media with the model manager, the file is renamed but the new path is not saved to the database and then this media is broken.
Environment:
Noticed it in 5.6.4, but in 5.7.11 it still looks exactly the same.
Steps to reproduce:
Load a media object with the model manager
Update the name of that media
Flush the object
Expected result:
The name and also the path are updated in the database
Actual result:
Only the name is updated in the database
The text was updated successfully, but these errors were encountered:
Description:
As you can see here, there is an "onUpdate" function in the Media model. It is executed on the doctrine event "PostUpdate", so after a media object is updated. If the name of the media object was changed, this function renames the file of the media and then it updates the "path" attribute. But this new "path" attribute is never saved to the database, because the media object was already saved (PostUpdate). So when you update the name of a media object and save this media with the model manager, the file is renamed but the new path is not saved to the database and then this media is broken.
Environment:
Noticed it in 5.6.4, but in 5.7.11 it still looks exactly the same.
Steps to reproduce:
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: