Commit f1f0c3f1 authored by Fabio Stegmeyer's avatar Fabio Stegmeyer

Merge branch 'bugfix_root_page_editing_and_new_subpage_per_context_menu' into 'master'

[BUGFIX] Fixing bug where saving changes for translated root-pages and...

See merge request !7
parents 256ba49b 6798f9a4
......@@ -264,45 +264,6 @@ class TceMainHook {
}
}
/**
* @param string $table
* @param integer $id
* @param array $data
* @param integer $res (but only 0 and 1 is relevant so it's boolean technically)
* @param $tcemain
* @return integer|NULL
* @throws Exception
* @internal param object $this
*/
public function checkRecordUpdateAccess($table, $id, $data, $res, $tcemain): ?int {
if (!BackendServices::isSupportedTable($table)) {
return $res;
}
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
$queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
$row = $queryBuilder->select('*')
->from($table)
->where(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT))
)
->setMaxResults(1)
->execute()->fetch();
if (!is_array($row)) {
return 0;
}
if ($table === 'pages' && !BackendServices::hasUserAccessToPageRecord($row, 'edit')) {
$result = 0;
} elseif (!BackendServices::hasUserAccessToEditRecord($table, $row)) {
$result = 0;
} else {
$result = $res;
}
return $result;
}
/**
* This function is called my TYPO each time an element is saved in the backend
*
......
......@@ -74,7 +74,7 @@ class FieldVisibilityUserFunction extends AbstractFormElement {
* @param NodeFactory $nodeFactory
* @param array $data
*/
public function __construct(NodeFactory $nodeFactory = null, array $data = []) {
public function __construct(NodeFactory $nodeFactory = NULL, array $data = []) {
if ($nodeFactory !== NULL) {
parent::__construct($nodeFactory, $data);
}
......@@ -85,11 +85,11 @@ class FieldVisibilityUserFunction extends AbstractFormElement {
/**
* Renders the language table for the given record
*
* @deprecated
* @param array $PA row data
* @param array $PA row data //todo rename PA
* @return string
* @noinspection PhpUnused
* @throws DBALException
* @deprecated
*/
public function user_fieldvisibility($PA): string {
$this->data['databaseRow'] = $PA['row'];
......@@ -102,7 +102,7 @@ class FieldVisibilityUserFunction extends AbstractFormElement {
/**
* @return array
*/
public function render() {
public function render(): array {
$result = $this->initializeResultArray();
$content = '';
......@@ -111,6 +111,15 @@ class FieldVisibilityUserFunction extends AbstractFormElement {
$uid = $this->data['databaseRow']['uid'];
$row = $this->data['databaseRow'];
// no language visibility table for root or unsaved pages
if ($row['pid'] <= 0) {
return ['html' =>
'<div class="alert alert-info">' .
$this->getLLL('backend.error.noVisibilitySettingsAvailable') .
'</div>'
];
}
//use the effectivePid as the databaserow pid instead of the "sorting" pid
$row['pid'] = $pageId;
......
......@@ -7,32 +7,32 @@
<generator>LFEditor</generator>
</header>
<body>
<trans-unit id="backend.contentElement.languageSetToAll" approved="yes">
<source>Language is set to all - element is visibily in every language.</source>
<target>Die Sprache ist auf "Alle" gesetzt. Das Element ist in jeder Sprache sichtbar.</target>
</trans-unit>
<trans-unit id="backend.contentElement.normal" approved="yes">
<source>this is a normal content element. (translations are managed with overlay records)</source>
<target>Dies ist ein normales Inhaltselement. (Übersetzungen werden über Overlay-Elemente verwaltet)</target>
</trans-unit>
<trans-unit id="backend.contentElement.notDefault" approved="yes">
<source>This content element is not in default language. Its only visible in the selected language.</source>
<target>Dieses Inhaltselement ist nicht in der Standard-Sprache. Es ist nur in der selektierten Sprache sichtbar.</target>
</trans-unit>
<trans-unit id="backend.contentElement.translated" approved="yes">
<source>this content element is already a translated version therefore content overlays are not suppoted.</source>
<target>Dieses Inhaltselemnt ist bereit eine übersetzte Version, darum sind Overlay-Elemente nicht unterstüzt.</target>
</trans-unit>
<trans-unit id="backend.justEditableInTheDefault" approved="yes">
<source>This field can only be edited in the default language.</source>
<target>Dieses Feld kann nur in der Standardsprache bearbeitet werden.</target>
</trans-unit>
<trans-unit id="backend.userNotAdmin" approved="yes">
<source>This field can only be edited by admins.</source>
<target>Dieses Feld kann nur von Admins bearbeitet werden.</target>
</trans-unit>
<trans-unit id="backend.visibilityLegend" approved="yes" xml:space="preserve">
<source><![CDATA[
<trans-unit id="backend.contentElement.languageSetToAll" approved="yes">
<source>Language is set to all - element is visibily in every language.</source>
<target>Die Sprache ist auf "Alle" gesetzt. Das Element ist in jeder Sprache sichtbar.</target>
</trans-unit>
<trans-unit id="backend.contentElement.normal" approved="yes">
<source>this is a normal content element. (translations are managed with overlay records)</source>
<target>Dies ist ein normales Inhaltselement. (Übersetzungen werden über Overlay-Elemente verwaltet)</target>
</trans-unit>
<trans-unit id="backend.contentElement.notDefault" approved="yes">
<source>This content element is not in default language. Its only visible in the selected language.</source>
<target>Dieses Inhaltselement ist nicht in der Standard-Sprache. Es ist nur in der selektierten Sprache sichtbar.</target>
</trans-unit>
<trans-unit id="backend.contentElement.translated" approved="yes">
<source>this content element is already a translated version therefore content overlays are not suppoted.</source>
<target>Dieses Inhaltselemnt ist bereit eine übersetzte Version, darum sind Overlay-Elemente nicht unterstüzt.</target>
</trans-unit>
<trans-unit id="backend.justEditableInTheDefault" approved="yes">
<source>This field can only be edited in the default language.</source>
<target>Dieses Feld kann nur in der Standardsprache bearbeitet werden.</target>
</trans-unit>
<trans-unit id="backend.userNotAdmin" approved="yes">
<source>This field can only be edited by admins.</source>
<target>Dieses Feld kann nur von Admins bearbeitet werden.</target>
</trans-unit>
<trans-unit id="backend.visibilityLegend" approved="yes">
<source><![CDATA[
<div class="form-group">
<div class="t3js-formengine-label"><h4 class="form-section-headline">Legend:</h4></div>
<div class="formengine-field-item t3js-formengine-field-item">
......@@ -44,7 +44,7 @@
</div>
</div>
]]></source>
<target><![CDATA[
<target><![CDATA[
<div class="form-group">
<div class="t3js-formengine-label"><h4 class="form-section-headline">Legende:</h4></div>
<div class="formengine-field-item t3js-formengine-field-item">
......@@ -56,111 +56,111 @@
</div>
</div>
]]></target>
</trans-unit>
<trans-unit id="lang_getlangsta_createNewTranslationHeaders" approved="yes">
<source>Create new translation headers</source>
<target>Erstelle neue Übersetzungköpfe</target>
</trans-unit>
<trans-unit id="lang_renderl10n_CEcount" approved="yes">
<source>Content Element Count</source>
<target>Anzahl der Inhaltselemente</target>
</trans-unit>
<trans-unit id="lang_renderl10n_badThingThereAre" approved="yes">
<source>ERROR: There are two or more page overlay records for this language! Only one is allowed!</source>
<target>Fehler: Es existieren mehr als eine Seitenübersetzung für diese Sprache! Nur eine ist erlaubt!</target>
</trans-unit>
<trans-unit id="lang_renderl10n_default" approved="yes">
<source>Default</source>
<target>Standard</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editDefaultLanguagePage" approved="yes">
<source>Edit default language page properties</source>
<target>Seiteneigenschaften in der Standardsprache bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editLangOverlays" approved="yes">
<source>Edit all language overlay records</source>
<target>Alle Seitenübersetzungen bearbeite</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editLanguageOverlayRecord" approved="yes">
<source>Edit language overlay record</source>
<target>Seitenübersetzung bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editPage" approved="yes">
<source>Edit page</source>
<target>Seite bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editPageLang" approved="yes">
<source>Edit page translation</source>
<target>Seitenübersetzung bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editPageProperties" approved="yes">
<source>Edit all page properties</source>
<target>Alle Seiteneigenschaften bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_page" approved="yes">
<source>Page</source>
<target>Seite</target>
</trans-unit>
<trans-unit id="lang_renderl10n_viewPage" approved="yes">
<source>View page</source>
<target>Seite ansehen</target>
</trans-unit>
<trans-unit id="pI_crDate" approved="yes">
<source>Created date</source>
<target>Erstellungsdatum</target>
</trans-unit>
<trans-unit id="pI_crUser" approved="yes">
<source>Created by</source>
<target>Erstellt von</target>
</trans-unit>
<trans-unit id="pI_lastChange" approved="yes">
<source>Last change</source>
<target>Letzte Änderung</target>
</trans-unit>
<trans-unit id="pI_lastChangeContent" approved="yes">
<source>Last change, content</source>
<target>Letzte Änderung, Inhalt</target>
</trans-unit>
<trans-unit id="pageInformation" approved="yes">
<source>Page information</source>
<target>Seiteninformationen</target>
</trans-unit>
<trans-unit id="page_sysnote" approved="yes">
<source>Internal notes</source>
<target>Interne Notizen</target>
</trans-unit>
<trans-unit id="page_title" approved="yes">
<source>Pagetree overview</source>
<target>Seitenbaum-Übersicht</target>
</trans-unit>
<trans-unit id="pages_0" approved="yes">
<source>Basic settings</source>
<target>Basiseinstellungen</target>
</trans-unit>
<trans-unit id="pages_1" approved="yes">
<source>Record overview</source>
<target>Eintragsübersicht</target>
</trans-unit>
<trans-unit id="pages_2" approved="yes">
<source>Cache and Age</source>
<target>Cache und Alter</target>
</trans-unit>
<trans-unit id="stat_period" approved="yes">
<source>Statistics in the period %s back to %s</source>
<target>Statistiken im Zeitraum zwischen %s und %s</target>
</trans-unit>
<trans-unit id="stat_type_0" approved="yes">
<source>Page hits</source>
<target>Seitenaufrufe</target>
</trans-unit>
<trans-unit id="stat_type_1" approved="yes">
<source>Total hits</source>
<target>Gesamte Aufrufe</target>
</trans-unit>
<trans-unit id="stat_type_2" approved="yes">
<source>Hits in main sections</source>
<target>Aufrufe in der Hauptsektion</target>
</trans-unit>
</trans-unit>
<trans-unit id="lang_getlangsta_createNewTranslationHeaders" approved="yes">
<source>Create new translation headers</source>
<target>Erstelle neue Übersetzungköpfe</target>
</trans-unit>
<trans-unit id="lang_renderl10n_CEcount" approved="yes">
<source>Content Element Count</source>
<target>Anzahl der Inhaltselemente</target>
</trans-unit>
<trans-unit id="lang_renderl10n_badThingThereAre" approved="yes">
<source>ERROR: There are two or more page overlay records for this language! Only one is allowed!</source>
<target>Fehler: Es existieren mehr als eine Seitenübersetzung für diese Sprache! Nur eine ist erlaubt!</target>
</trans-unit>
<trans-unit id="lang_renderl10n_default" approved="yes">
<source>Default</source>
<target>Standard</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editDefaultLanguagePage" approved="yes">
<source>Edit default language page properties</source>
<target>Seiteneigenschaften in der Standardsprache bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editLangOverlays" approved="yes">
<source>Edit all language overlay records</source>
<target>Alle Seitenübersetzungen bearbeite</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editLanguageOverlayRecord" approved="yes">
<source>Edit language overlay record</source>
<target>Seitenübersetzung bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editPage" approved="yes">
<source>Edit page</source>
<target>Seite bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editPageLang" approved="yes">
<source>Edit page translation</source>
<target>Seitenübersetzung bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_editPageProperties" approved="yes">
<source>Edit all page properties</source>
<target>Alle Seiteneigenschaften bearbeiten</target>
</trans-unit>
<trans-unit id="lang_renderl10n_page" approved="yes">
<source>Page</source>
<target>Seite</target>
</trans-unit>
<trans-unit id="lang_renderl10n_viewPage" approved="yes">
<source>View page</source>
<target>Seite ansehen</target>
</trans-unit>
<trans-unit id="pI_crDate" approved="yes">
<source>Created date</source>
<target>Erstellungsdatum</target>
</trans-unit>
<trans-unit id="pI_crUser" approved="yes">
<source>Created by</source>
<target>Erstellt von</target>
</trans-unit>
<trans-unit id="pI_lastChange" approved="yes">
<source>Last change</source>
<target>Letzte Änderung</target>
</trans-unit>
<trans-unit id="pI_lastChangeContent" approved="yes">
<source>Last change, content</source>
<target>Letzte Änderung, Inhalt</target>
</trans-unit>
<trans-unit id="pageInformation" approved="yes">
<source>Page information</source>
<target>Seiteninformationen</target>
</trans-unit>
<trans-unit id="page_sysnote" approved="yes">
<source>Internal notes</source>
<target>Interne Notizen</target>
</trans-unit>
<trans-unit id="page_title" approved="yes">
<source>Pagetree overview</source>
<target>Seitenbaum-Übersicht</target>
</trans-unit>
<trans-unit id="pages_0" approved="yes">
<source>Basic settings</source>
<target>Basiseinstellungen</target>
</trans-unit>
<trans-unit id="pages_1" approved="yes">
<source>Record overview</source>
<target>Eintragsübersicht</target>
</trans-unit>
<trans-unit id="pages_2" approved="yes">
<source>Cache and Age</source>
<target>Cache und Alter</target>
</trans-unit>
<trans-unit id="stat_period" approved="yes">
<source>Statistics in the period %s back to %s</source>
<target>Statistiken im Zeitraum zwischen %s und %s</target>
</trans-unit>
<trans-unit id="stat_type_0" approved="yes">
<source>Page hits</source>
<target>Seitenaufrufe</target>
</trans-unit>
<trans-unit id="stat_type_1" approved="yes">
<source>Total hits</source>
<target>Gesamte Aufrufe</target>
</trans-unit>
<trans-unit id="stat_type_2" approved="yes">
<source>Hits in main sections</source>
<target>Aufrufe in der Hauptsektion</target>
</trans-unit>
</body>
</file>
</xliff>
......@@ -158,6 +158,9 @@
<trans-unit id="tx_languagevisibility_visibility_flag.record_flag">
<target>Einstellung</target>
</trans-unit>
<trans-unit id="backend.error.noVisibilitySettingsAvailable" approved="yes">
<target><![CDATA[Keine Sichtbarkeits-Einstellungen verfügbar. Sie befinden sich entweder auf einer Root-Seite [pid = 0] oder einer noch nicht gespeicherten Seite.]]></target>
</trans-unit>
</body>
</file>
</xliff>
......@@ -7,26 +7,26 @@
<generator>LFEditor</generator>
</header>
<body>
<trans-unit id="backend.contentElement.languageSetToAll">
<source>Language is set to all - element is visibily in every language.</source>
</trans-unit>
<trans-unit id="backend.contentElement.normal">
<source>this is a normal content element. (translations are managed with overlay records)</source>
</trans-unit>
<trans-unit id="backend.contentElement.notDefault">
<source>This content element is not in default language. Its only visible in the selected language.</source>
</trans-unit>
<trans-unit id="backend.contentElement.translated">
<source>this content element is already a translated version therefore content overlays are not suppoted.</source>
</trans-unit>
<trans-unit id="backend.justEditableInTheDefault">
<source>This field can only be edited in the default language.</source>
</trans-unit>
<trans-unit id="backend.userNotAdmin">
<source>This field can only be edited by admins.</source>
</trans-unit>
<trans-unit id="backend.visibilityLegend" xml:space="preserve">
<source><![CDATA[
<trans-unit id="backend.contentElement.languageSetToAll">
<source>Language is set to all - element is visibily in every language.</source>
</trans-unit>
<trans-unit id="backend.contentElement.normal">
<source>this is a normal content element. (translations are managed with overlay records)</source>
</trans-unit>
<trans-unit id="backend.contentElement.notDefault">
<source>This content element is not in default language. Its only visible in the selected language.</source>
</trans-unit>
<trans-unit id="backend.contentElement.translated">
<source>this content element is already a translated version therefore content overlays are not suppoted.</source>
</trans-unit>
<trans-unit id="backend.justEditableInTheDefault">
<source>This field can only be edited in the default language.</source>
</trans-unit>
<trans-unit id="backend.userNotAdmin">
<source>This field can only be edited by admins.</source>
</trans-unit>
<trans-unit id="backend.visibilityLegend">
<source><![CDATA[
<div class="form-group">
<div class="t3js-formengine-label"><h4 class="form-section-headline">Legend:</h4></div>
<div class="formengine-field-item t3js-formengine-field-item">
......@@ -38,85 +38,85 @@
</div>
</div>
]]></source>
</trans-unit>
<trans-unit id="lang_getlangsta_createNewTranslationHeaders">
<source>Create new translation headers</source>
</trans-unit>
<trans-unit id="lang_renderl10n_CEcount">
<source>Content Element Count</source>
</trans-unit>
<trans-unit id="lang_renderl10n_badThingThereAre">
<source>ERROR: There are two or more page overlay records for this language! Only one is allowed!</source>
</trans-unit>
<trans-unit id="lang_renderl10n_default">
<source>Default</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editDefaultLanguagePage">
<source>Edit default language page properties</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editLangOverlays">
<source>Edit all language overlay records</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editLanguageOverlayRecord">
<source>Edit language overlay record</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editPage">
<source>Edit page</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editPageLang">
<source>Edit page translation</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editPageProperties">
<source>Edit all page properties</source>
</trans-unit>
<trans-unit id="lang_renderl10n_page">
<source>Page</source>
</trans-unit>
<trans-unit id="lang_renderl10n_viewPage">
<source>View page</source>
</trans-unit>
<trans-unit id="pI_crDate">
<source>Created date</source>
</trans-unit>
<trans-unit id="pI_crUser">
<source>Created by</source>
</trans-unit>
<trans-unit id="pI_lastChange">
<source>Last change</source>
</trans-unit>
<trans-unit id="pI_lastChangeContent">
<source>Last change, content</source>
</trans-unit>
<trans-unit id="pageInformation">
<source>Page information</source>
</trans-unit>
<trans-unit id="page_sysnote">
<source>Internal notes</source>
</trans-unit>
<trans-unit id="page_title">
<source>Pagetree overview</source>
</trans-unit>
<trans-unit id="pages_0">
<source>Basic settings</source>
</trans-unit>
<trans-unit id="pages_1">
<source>Record overview</source>
</trans-unit>
<trans-unit id="pages_2">
<source>Cache and Age</source>
</trans-unit>
<trans-unit id="stat_period">
<source>Statistics in the period %s back to %s</source>
</trans-unit>
<trans-unit id="stat_type_0">
<source>Page hits</source>
</trans-unit>
<trans-unit id="stat_type_1">
<source>Total hits</source>
</trans-unit>
<trans-unit id="stat_type_2">
<source>Hits in main sections</source>
</trans-unit>
</trans-unit>
<trans-unit id="lang_getlangsta_createNewTranslationHeaders">
<source>Create new translation headers</source>
</trans-unit>
<trans-unit id="lang_renderl10n_CEcount">
<source>Content Element Count</source>
</trans-unit>
<trans-unit id="lang_renderl10n_badThingThereAre">
<source>ERROR: There are two or more page overlay records for this language! Only one is allowed!</source>
</trans-unit>
<trans-unit id="lang_renderl10n_default">
<source>Default</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editDefaultLanguagePage">
<source>Edit default language page properties</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editLangOverlays">
<source>Edit all language overlay records</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editLanguageOverlayRecord">
<source>Edit language overlay record</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editPage">
<source>Edit page</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editPageLang">
<source>Edit page translation</source>
</trans-unit>
<trans-unit id="lang_renderl10n_editPageProperties">
<source>Edit all page properties</source>
</trans-unit>
<trans-unit id="lang_renderl10n_page">
<source>Page</source>
</trans-unit>
<trans-unit id="lang_renderl10n_viewPage">
<source>View page</source>
</trans-unit>
<trans-unit id="pI_crDate">
<source>Created date</source>
</trans-unit>
<trans-unit id="pI_crUser">
<source>Created by</source>
</trans-unit>
<trans-unit id="pI_lastChange">
<source>Last change</source>
</trans-unit>
<trans-unit id="pI_lastChangeContent">
<source>Last change, content</source>
</trans-unit>
<trans-unit id="pageInformation">
<source>Page information</source>
</trans-unit>
<trans-unit id="page_sysnote">
<source>Internal notes</source>
</trans-unit>
<trans-unit id="page_title">
<source>Pagetree overview</source>
</trans-unit>
<trans-unit id="pages_0">
<source>Basic settings</source>
</trans-unit>
<trans-unit id="pages_1">
<source>Record overview</source>
</trans-unit>
<trans-unit id="pages_2">
<source>Cache and Age</source>
</trans-unit>
<trans-unit id="stat_period">
<source>Statistics in the period %s back to %s</source>
</trans-unit>
<trans-unit id="stat_type_0">
<source>Page hits</source>
</trans-unit>
<trans-unit id="stat_type_1">
<source>Total hits</source>
</trans-unit>
<trans-unit id="stat_type_2">
<source>Hits in main sections</source>
</trans-unit>
</body>
</file>
</xliff>
......@@ -124,6 +124,9 @@
<trans-unit id="tx_languagevisibility_visibility_flag.record_flag">
<source>Flag</source>
</trans-unit>
<trans-unit id="backend.error.noVisibilitySettingsAvailable">
<source><![CDATA[No visibility-settings available. Your are either on a root-page [pid = 0] or an not yet saved page.]]></source>
</trans-unit>
</body>
</file>
</xliff>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment