Bug #10693
closedSave and view command previews wrong page record
100%
Description
When editing a version of a page record in a workspace and pressing the "Save and view" button, the wrong page id is called.
Assuming an existing page with id = 55. It is edited and gets a version overlay record with id = 67.
When previewing through Web > List of Web > List (i.e. when relying on links generated by t3lib_BEfunc::viewOnClick()), the URL generated is:
http:www.example.com/index.php?id=55
But when clicking on the "Save and view" icon after editing the page, the URL generated is:
http:www.example.com/index.php?id=67
This causes various problems when the split-screen preview (a.k.a. "Frontend preview" is enable):
- if the page was just modified or a new page was created, the LIVE frame will show a broken rootline error, the Workspace frame is correct
- if the page was moved, you get a "page not found" error in both frames
The obvious solution is to change the "Save and view" behavior so that it uses the "t3ver_oid" in case it exists rather than the "uid" to generate the preview URL.
I'm going to work on a patch for this (writing this bug report helped me think about various scenarios, now I need to write the proper patch). I'm submitting this here rather than to the Core list because I wanted to have some feedback from the workspace team before submitting a patch to the core list.
Files
Updated by Oliver Hader about 14 years ago
This issue is related to the official TYPO3 Core and not to the new workspaces module based on ExtJS. However, it still has to be solved... ;-)
Updated by Francois Suter about 14 years ago
- File forge10693.diff forge10693.diff added
As mentioned by Olly, this bug is actually related to the TYPO3 Core, but I still wanted to submit it here first to discuss the solution with more workspace-savvy people.
A quick way to reproduce the problem:
- place yourself in some workspace other than LIVE
- make sure that the split-screen preview is enabled
- create a new page and save it a first time
- now that the page is saved, the "Save and view" icon becomes available: click on it
You should see the following result:
- in the LIVE frame, there should be a broken rootline error
- in the workspace preview frame, the new page can be previewed normally
Now move to Web > List module and click on the "View" icon. The result is not the same. The LIVE frame displays a nice error message saying: "New page! The previewed page is created in the workspace and has no counterpart in the live workspace.".
The error on "Save and view" happens because this command calls the version overlay of the page rather than the original page itself. The proper behavior is to call the page with its original uid and let TYPO3 do all the overlay stuff.
The attached patch fixes this behavior, by changing the popViewId parameter that's used during the "Save and view" process. The patch was made for TYPO3 4.4. I would like to discuss how best to make a TYPO3 4.5 version, given the cleaner splitting of version-related code that we have now.
Thanks in advance for your feedback. I hope the bug description is clear enough.
Updated by Tolleiv Nietsch about 14 years ago
I haven't checked yet but I guess to trigger the preview everything is passed through - t3lib_beFunc::viewOnClick right? If so - I'd say it would be better to solve this issue there - this would imho be much more robust...
Updated by Francois Suter about 14 years ago
- File forge10693_v2.diff forge10693_v2.diff added
I haven't checked yet but I guess to trigger the preview everything is passed through - t3lib_beFunc::viewOnClick right? If so - I'd say it would be better to solve this issue there - this would imho be much more robust...
You are right. Actually this was my original approach, but at the time I had not identified the problem correctly. By the time I had found the right cause, I had switched solution ;-) But patching t3lib_beFunc::viewOnClick() also works. Done in attached v2 of the patch.
I guess the solution for 4.5 would imply to introduce a hook to manipulate the id in t3lib_beFunc::viewOnClick().
Updated by Tolleiv Nietsch about 14 years ago
my last patch for http://bugs.typo3.org/view.php?id=13610 might be enough for this - I'll check that in the evening
Updated by Francois Suter about 14 years ago
my last patch for http://bugs.typo3.org/view.php?id=13610 might be enough for this - I'll check that in the evening
Thanks for the pointer, I'll check it out.
Updated by Tolleiv Nietsch almost 14 years ago
- Status changed from New to Accepted
- Assignee set to Tolleiv Nietsch
- Target version set to 4.5 Beta 3
Updated by Tolleiv Nietsch almost 14 years ago
- File 10693.patch 10693.patch added
- Status changed from Accepted to Under Review
Hi,
just reviewed the affected functions (t3lib_pageSelect::getMountpointInfo(), t3lib_beFunc::getViewDomain()) and it seems that both more or less rely on live-pids too (both make the workspace-overlays internally on their own). So I assume that the patch we discussed earlier fully fits our needs.
The attached patch has been set as RFC patch to the typo3.teams.workspace newsgroup.
Cheers, Tolleiv
Updated by Tolleiv Nietsch almost 14 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Committed to trunk (rev. 3490).
Updated by Francois Suter almost 14 years ago
FYI submitted a patch to the core list to solve the issue for older branches (4.3 and 4.4). See: http://bugs.typo3.org/view.php?id=16794
Updated by Michael Stucki almost 11 years ago
- Project changed from 624 to TYPO3 Core
- Category changed from Workspaces to Workspaces
- Target version deleted (
4.5 Beta 3)