Bug #19377

Versioning Preview: records that require a singlePid don't work (eg tt_news)

Added by Jochen Rieger about 12 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2008-09-25
Due date:
% Done:

0%

TYPO3 Version:
4.2
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

If you want to preview a created / edited new version of a tt_news record that is stored in a sysfolder, you won't be able to call it in FE via the BE view-Link.

Possible solution:

Method "selectVersionsOfRecord" should take in account a page TS config setting to set the "_REAL_PID" which is used as the page uid that rhe record will be shown on... of cause this would be the page then containing the necessary plugin in single view / version preview mode.

In case I am right with my assupmtions I'd try to make a patch for this. Or am I missing something?
(issue imported from #M9428)


Related issues

Related to TYPO3 Core - Bug #31996: Workspace preview does not transfer query parameters Closed 2011-11-22

History

#1 Updated by Tolleiv Nietsch over 8 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)

Are you still willing to provide a patch?

#2 Updated by Jochen Rieger over 8 years ago

Hi Tolleiv,

I'd love to - but I'm afraid that I am too far away from that topic. Especially because I haven't followed the development in this core area since 4.2.

I'm sure, a lot has changed since then, no? Maybe anybody else willing to tackle this who is more into versioning / workspaces?

#3 Updated by Stefan Froemken about 8 years ago

This bug is a problem of two parts:

1.) The correct url for preview of singleview records like tt_news are only generated if the record was NOT created in the workspace. Have a look into class.tx_ttnews_tcemain.php:

if (isset($GLOBALS['_POST']['_savedokview_x']) && !$fieldArray['type'] && !$GLOBALS['BE_USER']->workspace) {

Here you have to remove the workspace part
if (isset($GLOBALS['_POST']['_savedokview_x']) && !$fieldArray['type']) {

First now, the pid of the news record will be converted to the pid of the singleview

2.) The new workspacing module can only work with pages. There is no part in the sourcecode to add the needed extension query to the uri like tx_ttnews[tt_news]=9:

$viewDomain = t3lib_BEfunc::getViewDomain($this->pageId);
$wsBaseUrl =  $viewDomain . '/index.php?id=' . $this->pageId . '&L=' . $language;

As you can see: Only the pid will be added to the new uri. I have changed this part to:
$getParams = $_GET;
$getParams['id'] = $this->pageId;
$getParams['L'] = $language;
unset($getParams['tx_workspaces_web_workspacesworkspaces']);
unset($getParams['M']);
$wsBaseUrl =  $viewDomain . '/index.php?' . http_build_query($getParams, '', '&');

With help of this modification we are now able to create a dynamically uri. Regardless of the used extension.
Have fun with it.

Stefan

#4 Updated by Michael Stucki almost 7 years ago

  • Category set to Workspaces

#5 Updated by Michael Stucki almost 7 years ago

  • Project changed from Workspaces & Versioning to TYPO3 Core
  • Category changed from Workspaces to Workspaces

#6 Updated by Alexander Opitz over 6 years ago

  • Is Regression set to No

Hi,

as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.1.7)?

#7 Updated by Jochen Rieger over 6 years ago

I just did some testing within the original Introduction Package of 6.1.7 together with news (the singlePid is configured in the page TS config of the folder containing the news records).

It still feels like a bug to me. Testing results as follows.

LIVE workspace

Edited a news record, hit "Save and View" button. Leads to a success: The news will be shown in FE on its configured detail page in full detail view.

URL: http://t3intro61.local/index.php?id=23&no_cache=1&tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]=4

DRAFT workspace

Edited a news record, hit "Save and View" button. Leads to failure: Somehow the configured page is called (PID 23) but it won't show the detail view of the news. In case of the intro package it shows the list view which is on the same page.

URL: http://t3intro61.local/typo3/mod.php?tx_workspaces_web_workspacesworkspaces%5BpreviewWS%5D=1&tx_workspaces_web_workspacesworkspaces%5Baction%5D=index&tx_workspaces_web_workspacesworkspaces%5Bcontroller%5D=TYPO3%5CCMS%5CWorkspaces%5CController%5CPreviewController&tx_workspaces_web_workspacesworkspaces%5Bcontroller%5D=Preview&M=web_WorkspacesWorkspaces&id=23&no_cache=1&tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]=7

#8 Updated by Alexander Opitz over 6 years ago

  • Status changed from Needs Feedback to New

#9 Updated by Mathias Schreiber almost 6 years ago

  • Target version set to 7.5

#10 Updated by Benni Mack about 5 years ago

  • Target version changed from 7.5 to 7 LTS

#11 Updated by Mathias Schreiber almost 5 years ago

  • Target version deleted (7 LTS)

#12 Updated by Benni Mack 8 months ago

  • Status changed from New to Needs Feedback

This should be fixed with 9.5.11. Can you confirm that this works as expected?

#13 Updated by Riccardo De Contardi 8 months ago

Test performed with version 9.5.14 and EXT:news 7.3.1

1) Use a "news configuration" with:

  • List page "News"
  • Detail page "Detail"
  • a Sysfolder "News Recipient"

2) Configure a "Draft" workspace
3) Create a news item in the sysfolder, name it "test" and write in it some text
4) switch to Draft workspace > edit the news item "test" and change the text
5) Go to the "News" page and preview it

Results

1) the "Preview" of the draft workspace is visible
2) clicking on the news title on the list you go to the detail page still in preview mode, so the modified version in workspace is visible
3) if I go to workspace module > news page and click on "generate page preview link" a preview link for the list page is generated; in this case only the list page is the one on the preview version; clicking on the news title will go to the detail page on the live version

it is possible to add the following page TSConfig to activate the "preview" button on the news record inside the sysfolder (123= ID of the detail page)

TCEMAIN.preview {
        tx_news_domain_model_news {
                useCacheHash = 1
                previewPageId = 123
                useDefaultLanguageRecord = 0
                fieldToParameterMap {
                        uid = tx_news_pi1[news_preview]
                }
                additionalGetParameters {
                        tx_news_pi1.controller = News
                        tx_news_pi1.action = detail
                }
        }
}

In this case, if you are in the Draft workspace, the modified version of the record in workspace is visible, too

I have not found a method to generate a preview link on the news record for people outside the CMS

#14 Updated by Benni Mack 7 months ago

  • Status changed from Needs Feedback to Closed

Thanks for the detailled analysis.

In this case, if you are in the Draft workspace, the modified version of the record in workspace is visible, too

IMHO the wanted desire - that one could preview news from the backend with the direct link, which is the important case and the original request by Jochen.

I have not found a method to generate a preview link on the news record for people outside the CMS

This isn't possible right now, and probably would need to have a proper UX concept first.

The "preview link" concept also looses the preview news detail page, which is related to another issue.

I will close this issue for now. If you still feel this bug report is not fully solved, please let me know and I will re-open the ticket.

Thanks for the patience on the 12 year old issue! We're getting closer on filling the workspace gaps!

Also available in: Atom PDF