-
Notifications
You must be signed in to change notification settings - Fork 48
EZP-28003: Unable to go back to the Content structure after content move to the Media library #913
EZP-28003: Unable to go back to the Content structure after content move to the Media library #913
Conversation
Just one comment from my side: I've used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sunpietro The bug with back button is solved in fact, but the issue with the second way to switch tab still exists.
After you moved the image to the Media -> Images you can use back button, but when you click on Content structure (currently, you should be under Media library) then you got the same exception and you have to reload the whole application.
@@ -2,6 +2,7 @@ | |||
* Copyright (C) eZ Systems AS. All rights reserved. | |||
* For full copyright and license information view LICENSE file distributed with this source code. | |||
*/ | |||
/*jshint esversion: 6 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be better to add this into config not per file
* @method _updatePrevHistory | ||
* @protected | ||
* @param {any} location | ||
* @param {any} callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not any
.
_updatePrevHistory(location, callback) { | ||
const urlPart = window.decodeURIComponent(window.location.hash); | ||
const language = urlPart.slice(urlPart.lastIndexOf('/'), urlPart.length); | ||
const hashStart = '#/view/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we avoid hardcoded parts?
ping @kmadejski @dew326 |
* @param {Event} event | ||
*/ | ||
_resetContentNavigationItem: function () { | ||
const contentItem = this.get('platformNavigationItems').find(item => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think method getNavigationItem
do the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this one is faster because I'm looking for a specific item in a specific zone. I don't have to iterate through all the zones to get that one specific item :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's faster around 0.0002ms :D
I think we should use dedicated methods for finding items if such method exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I can agree to this option.
…ove to the Media library
@kmadejski Could you help test this? |
@sunpietro works well. Just only one thing, when I moved content I got an exception, to be more precise I got the only red notification on the bottom. There is no error in console and no invalid request in Network tab (in developer tools). |
I think it's something from the StudioUI. Do you have Platform or Platform EE? |
If you have eZPlatform-EE then you definitely need the code from the PR I referenced above. |
@sunpietro I apologize, I overlooked this reference. I patched also StudioUI bundle, and yes, the previous message doesn't appear anymore, but I've got another "red" message (no Console/Network errors). I'm getting this message right after entry to the Content structure tab. @dew326 it is Platform EE 1.11. |
@kmadejski I'm on it |
@sunpietro after update with https://github.com/ezsystems/StudioUIBundle/pull/852 everything works well! |
Question: Isn't it a BC break if changes in PlatformUI requires additional work in StudioUI? |
@dew326 it's not BC break. PlatformUI didn't have any functionality to correct the history of previously visited pages after moving a content item to a new location. This fix corrects this behaviour. |
@micszo we need a QA here + corresponding Studio PR. |
@lserwatka OK, it's top on the list now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retest OK with eZ Platform 1.11.0.3 and eZ Platform EE 1.11.0.
Please attach patch.
https://jira.ez.no/browse/EZP-28003