Project

General

Profile

Actions

Bug #18761

closed

"ADMCMD command could not be executed!" after preview link expired

Added by Christian Hennecke almost 16 years ago. Updated almost 4 years ago.

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

100%

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

Description

I generate a preview link from a workspace and visited that link. After the link expired and the content was published, I got the following error on trying to access the live site:

"ADMCMD command could not be executed!"

Removing the cookies for the site solved the problem.

(issue imported from #M8352)


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #77569: Workspaces PReview Links: Live-Website is not shown anymore after ADMCMD_prev cookie is set onceClosed2016-08-22

Actions
Actions #1

Updated by Tolleiv Nietsch over 12 years ago

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

What's the actual issue? That the link was expired or that you saw a page even after the link expired?

Actions #2

Updated by Christian Hennecke over 12 years ago

Tolleiv Nietsch wrote:

What's the actual issue? That the link was expired or that you saw a page even after the link expired?

The problem is that I get an error message when visiting a page of the LIVE site that had been edited in a workspace before. The expected behaviour would be that the system displays the live version.

Actions #3

Updated by Martin Holtz over 12 years ago

i just had the same issue in a test installation (4.5.3).
A few days ago i tried different settings with the workspaces. Today i logged in, just tried to show the page and got that error.

Sorry, i did not checked the cookie, just deleted it. Now everything works fine.

Actions #4

Updated by Tolleiv Nietsch about 12 years ago

Sorry I'm not able to reproduce this - is this still valid?

Actions #5

Updated by Jan Boysen almost 12 years ago

Tolleiv Nietsch wrote:

Sorry I'm not able to reproduce this - is this still valid?

Hi..

I just was able to reproduce it ( at least some kind as the error is different, but seems related to it ).
( Typo3 version 4.6.7 )
Here are the steps:

- Created a new Workspace
- Modified some things in the workspace
- Generated a preview link for that workspace
- After the Link has expired the entire frontend just shows "Oops, an error occurred!"
- Removing the coockie named ADMCMD_prev everything is ok again.

The coockie:
Name: ADMCMD_prev
Content: 5868c49194cb392b306678d1a51a6b6f
Domain: ********
Path: /
Send For: Any kind of connection
Accessible to Script: Yes
Created: Sunday, April 8, 2012 5:06:59 PM
Expires: When I close my browser

So the bugfix in my eyes would be so set a specific expiredate for the coockie and not "When I close my browser" as I did not close my entire Browser, which in real happens maybe once a week or even more seldom.

Actions #6

Updated by Lars Houmark about 11 years ago

Still a problem with 4.7.x and I can confirm the same symptoms as prior comments.

After deleting the cookie, the site works again.

A solution could be to either put the expiry time on the cookie to be the same as the preview link or a better verification of the cookie by TYPO3 when it's evaluation it.

This is some advanced ** but hopefully I can look into a patch soon. Anyone else wants to help out?

Actions #7

Updated by Martin Terber over 10 years ago

Got that error in 4.5.29, Chrome 19, but not n Firefox. Same symptoms as above. Removing cookies solved the problem.

Actions #8

Updated by Christoph Holtermann over 10 years ago

I got the same problem today.

Chrome works ( 30.0.1553.0 (209444), there was no cookie set )
Firefox ( 24.0 ) does not.

Typo3 4.7.15

Steps: Installing workspaces extension, followed a preview link some days ago. Afterwards
regular browsing of the site without using that link again.

Cookie ADMCMD_prev. Removal led to normal function.

-> Why does a cookie change the behaviour of my browser when I just visit the same
site ?

debug log:

13-10-17 21:00:45 FATAL    Core: Exception handler (WEB) Uncaught TYPO3 Exception: #1294585192: ADMCMD command could not be executed! (No keyword configuration found) | Exception thrown in file /var/www/web0/html/Typo3/typo3_src-4.7.15/typo3/sysext/version/Classes/Preview.php in line 226. Requested URL: http://www.jungmedizinerforum.org/
    TYPO3_MODE => FE
    backtrace => array (
       0 => array (
          file => /var/www/web0/html/Typo3/typo3_src-4.7.15/typo3/sysext/version/Classes/Preview.php
          line => 64

          function => getPreviewConfiguration
          class => Tx_Version_Preview
          type => ->
          args => array (
          )
       )
       1 => array (
          function => checkForPreview
          class => Tx_Version_Preview
          type => ->
          args => array (
             0 => array (
                pObj => object: tslib_fe
             )
             1 => object: tslib_fe
          )
       )
       2 => array (
          file => /var/www/web0/html/Typo3/typo3_src-4.7.15/t3lib/class.t3lib_div.php
          line => 4668
          function => call_user_func_array
          args => array (
             0 => array (
                0 => object: Tx_Version_Preview
                1 => checkForPreview
             )
             1 => array (
                0 => array (
                   pObj => object: tslib_fe
                )
                1 => object: tslib_fe
             )
          )
       )
       3 => array (
          file => /var/www/web0/html/Typo3/typo3_src-4.7.15/typo3/sysext/cms/tslib/class.tslib_fe.php
          line => 389
          function => callUserFunction
          class => t3lib_div

          type => ::
          args => array (
             0 => EXT:version/Classes/Preview.php:Tx_Version_Preview->checkForPreview
             1 => array (
                pObj => object: tslib_fe
             )
             2 => object: tslib_fe
          )
       )
       4 => array (
          file => /var/www/web0/html/Typo3/typo3_src-4.7.15/typo3/sysext/cms/tslib/index_ts.php
          line => 185
          function => connectToDB
          class => tslib_fe
          type => ->
          args => array (
          )
       )
       5 => array (
          file => /var/www/web0/html/Typo3/typo3_src-4.7.15/index.php
          line => 76
          args => array (
             0 => /var/www/web0/html/Typo3/typo3_src-4.7.15/typo3/sysext/cms/tslib/index_ts.php
          )
          function => require
       )
    )

Actions #9

Updated by Michael Stucki over 10 years ago

  • Category set to Workspaces
Actions #10

Updated by Michael Stucki over 10 years ago

  • Project changed from 624 to TYPO3 Core
  • Category changed from Workspaces to Workspaces
Actions #11

Updated by Andreas Siegel about 10 years ago

I just had the same issue with TYPO3 6.1.7 and workspaces 6.1.0.

As in the other cases, removing the cookies solved the problem, but before the entire website was not available for about one day.

Actions #12

Updated by Alexander Opitz about 10 years ago

  • Status changed from Needs Feedback to New
  • Is Regression set to No
Actions #13

Updated by Markus Timtner almost 10 years ago

Still present in 6.2.*

The expected behaviour should be:
if hte cookie is not valid anymore,
just show the live site instead!

Actions #14

Updated by Markus Timtner almost 10 years ago

This fixes the problem, but I honestly don't know if this could have unwanted sideeffects:

typo3/sysext/version/Classes/Hook/PreviewHook.php
#198ff

            } else {
+                if (isset($_COOKIE['ADMCMD_prev'])) {
+                    unset($_COOKIE['ADMCMD_prev']);
+                }
-                // throw new \Exception('ADMCMD command could not be executed! (No keyword configuration found)', 1294585192);
            }

Actions #15

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30091

Actions #16

Updated by Gerrit Code Review almost 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30091

Actions #17

Updated by Teamgeist Medien over 9 years ago

The above fix solves the problem for me. Thanks.

Actions #18

Updated by Mathias Schreiber about 9 years ago

  • Target version set to 7.5
Actions #19

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #20

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30091

Actions #21

Updated by Gerrit Code Review about 8 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30091

Actions #22

Updated by Robert Vock over 7 years ago

We added a hook to our base-setup to fix this issue until this bug gets fixed.

ext_localconf.php:

// **************
// Expired Preview links throw an exception. The only solution is to delete the cookie
// This is really user-unfriendly
// @see https://forge.typo3.org/issues/18761
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('version')) {
    array_unshift($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'], 'Vierwd\\VierwdBase\\Hooks\\VersioningHooks->removeExpiredPreviewCookie');
}

VersioningHooks.php

public function removeExpiredPreviewCookie() {
    if (isset($_COOKIE['ADMCMD_prev'])) {
        // check if the cookie is valid. if not, delete it
        $inputCode = $_COOKIE['ADMCMD_prev'];
        $where = 'keyword=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($inputCode, 'sys_preview') . ' AND endtime>' . $GLOBALS['EXEC_TIME'];
        $previewData = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_preview', $where);
        if (!$previewData) {
            // remove cookie
            unset($_COOKIE['ADMCMD_prev']);
            setcookie('ADMCMD_prev', '', 0, GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'));
        }
    }
}

Actions #23

Updated by Gerrit Code Review over 7 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30091

Actions #24

Updated by Gerrit Code Review about 7 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30091

Actions #25

Updated by Gerrit Code Review about 7 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30091

Actions #26

Updated by Jens Engelmann over 6 years ago

Is there any progress on that issue? We still experience the behaviour on 8.7 LTS installations.

Actions #27

Updated by Susanne Moog about 5 years ago

  • Status changed from Under Review to Accepted

Review was abandoned.

Actions #28

Updated by Gerrit Code Review about 4 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63818

Actions #29

Updated by Gerrit Code Review about 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63818

Actions #30

Updated by Gerrit Code Review about 4 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63783

Actions #31

Updated by Benni Mack about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #32

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF