Project

General

Profile

Actions

Bug #10693

closed

Save and view command previews wrong page record

Added by Francois Suter about 14 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Workspaces
Target version:
-
Start date:
2010-11-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

forge10693.diff (2.13 KB) forge10693.diff Francois Suter, 2010-11-10 09:56
forge10693_v2.diff (913 Bytes) forge10693_v2.diff Francois Suter, 2010-11-10 11:01
10693.patch (2 KB) 10693.patch Tolleiv Nietsch, 2010-11-24 20:04
Actions #1

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... ;-)

Actions #2

Updated by Francois Suter about 14 years ago

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:

  1. place yourself in some workspace other than LIVE
  2. make sure that the split-screen preview is enabled
  3. create a new page and save it a first time
  4. now that the page is saved, the "Save and view" icon becomes available: click on it

You should see the following result:

  1. in the LIVE frame, there should be a broken rootline error
  2. 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.

Actions #3

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...

Actions #4

Updated by Francois Suter 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...

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().

Actions #5

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

Actions #6

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.

Actions #7

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
Actions #8

Updated by Tolleiv Nietsch almost 14 years ago

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

Actions #9

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).

Actions #10

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

Actions #11

Updated by Michael Stucki almost 11 years ago

  • Category set to Workspaces
Actions #12

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)
Actions #13

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF