Project

General

Profile

Actions

Bug #24851

closed

Dependencies in sysext 'version' and 'workspaces'

Added by Sascha no-lastname-given over 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2011-01-27
Due date:
% Done:

0%

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

Description

Hey there,

within the sysext 'version' extension (version/cm1/index.php) in line 172 there is a query on 'sys_workspace' table. This table only exist if sysext 'workspace' is installed. The Query returns something that produces a php warning within the foreach. Its just a warning, but it isn't realy nice. In my case 'version manag.' is installed but not 'workspace manag.'.

Maybe my installation (4.5_trunk) was broken while updating all the time. Just want to be sure...

see also http://forge.typo3.org/issues/12615
(issue imported from #M17355)


Files

0017355.patch (8.5 KB) 0017355.patch Administrator Admin, 2011-01-27 16:24
0017355_v2_core.patch (7.48 KB) 0017355_v2_core.patch Administrator Admin, 2011-01-28 14:17
0017355_v2_workspaces.patch (8.58 KB) 0017355_v2_workspaces.patch Administrator Admin, 2011-01-28 14:17

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #24632: sys_workspace table should be defined at one place onlyClosedTolleiv Nietsch2011-01-18

Actions
Actions #1

Updated by Oliver Hader over 13 years ago

There are more places where sys_workspace is used without checking whether the workspaces extension is installed.

Actions #2

Updated by Sascha no-lastname-given over 13 years ago

Ah, ok. Just get these php warnings and want to be sure.

Actions #3

Updated by Benni Mack over 13 years ago

Happened because of this change: http://bugs.typo3.org/view.php?id=17106

Actions #4

Updated by Ernesto Baschny over 13 years ago

We decided to go throughout the core and add proper checks where appropriate so that these queries aren't generated anymore if one doesn't have workspaces installed.

Only lacking place would be extensions which might be used to assume this table is there (while its now optional). If you know of any, please report here, so that we can contact the authors or try to find some solution.

In the meantime, you might consider manually creating the empty table so that you don't hit any other side-effects:

CREATE TABLE sys_workspace (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
deleted tinyint(1) DEFAULT '0' NOT NULL,
title varchar(30) DEFAULT '' NOT NULL,
description varchar(255) DEFAULT '' NOT NULL,
adminusers text,
members text,
reviewers text,
db_mountpoints varchar(255) DEFAULT '' NOT NULL,
file_mountpoints varchar(255) DEFAULT '' NOT NULL,
publish_time int(11) DEFAULT '0' NOT NULL,
unpublish_time int(11) DEFAULT '0' NOT NULL,
freeze tinyint(3) DEFAULT '0' NOT NULL,
live_edit tinyint(3) DEFAULT '0' NOT NULL,
review_stage_edit tinyint(3) DEFAULT '0' NOT NULL,
vtypes tinyint(3) DEFAULT '0' NOT NULL,
disable_autocreate tinyint(1) DEFAULT '0' NOT NULL,
swap_modes tinyint(3) DEFAULT '0' NOT NULL,
publish_access tinyint(3) DEFAULT '0' NOT NULL,
stagechg_notification tinyint(3) DEFAULT '0' NOT NULL,

PRIMARY KEY (uid),
KEY parent (pid)
);
Actions #5

Updated by Sascha no-lastname-given over 13 years ago

Hey all,

thanks for explanation. For me it isn't a problem, i just get these warnings within my trunk/debug installation and saw these missing check. I should post such things to mailinglist instead of report a bug, i think.

Actions #6

Updated by Oliver Hader over 13 years ago

I analysed the scenario a bit and it's not that bad as I initially thought...

  • sys_workspace was defined in TCA so there are some checks that iterate over all available TCA tables (e.g. the list module does so) - by removing it from the system extension version, it's fine again
  • other places that use workspace overlays check against the current workspaces state of the backend user - so this is somehow already a check for t3lib_extMgm::isLoaded('workspaces')
  • the definitions (TCA and SQL) is already present in the workspaces system extension

Please try the attached patch.
(internal: if patch gets approved this was to be committed to the version SVN repository, not to the main core SVN rep.)

Actions #7

Updated by Tolleiv Nietsch over 13 years ago

patch looks good, +1 by reading

Actions #8

Updated by Ernesto Baschny over 13 years ago

Olly there are more places doing a SQL query with sys_workspaces table without checking anything, e.g.

- beusers (Admin>Users): there are checkboxes which allow the admin to compare user based on WS settings. Those should be disabled if no WS is installed

- belog (Admin>Log) there's a select box to select actions on certain WS. This has to be disabled.

- tslib_fe::whichWorkspace() which is a public function (might be called by extensions) and doesn't check if the table is there

- lowlevel also assumes the table is there and spits out SQL errors when you access Admin>DB check

- some public functions in class.t3lib_userauthgroup.php also assume the tables are there (there are checks for EXT:version there, thou)

- t3lib_pageSelect::checkWorkspaceAccess ditto

Shouldn't those be fixed also?

Actions #9

Updated by Steffen Kamper over 13 years ago

+1 by reading with CGL nitpicking :)

Actions #10

Updated by Sascha no-lastname-given over 13 years ago

Looks nice, and works for me. Warning is gone... :-)

Actions #11

Updated by Oliver Hader over 13 years ago

@Ernesto: Thanks for the suggestion. I now also added the other parts in the Core as you mentioned.
There are two files - one for the project on forge (version/workspaces) and the other one for the core.

Actions #12

Updated by Albert van der Veen over 13 years ago

This may be covered by the patch already, but if I view the BE log (Admin -> Log) the following error occurs:

table 'sys_workspace' doesn't exist

from query:

SELECT uid,title FROM sys_workspace WHERE pid=0 ORDER BY title

Actions #13

Updated by Loek Hilgersom about 13 years ago

+1 by testing - errors are gone where they showed up before (e.g. when opening log-module in BE), haven't noticed anything going bust yet, patches applied to 2 not-so-important sites, like my own ;-)

Actions #14

Updated by Oliver Hader about 13 years ago

Committed to SVN
  • TYPO3_4-5 (rev. 10477)
  • Trunk (rev. 10478)
Actions

Also available in: Atom PDF