From 330803decba6955a8b404e89ebcb787c34991440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20R?= Date: Fri, 29 Jun 2018 10:39:06 +0200 Subject: [PATCH 01/11] [Composer] Bump conflict to kernel <6.13 & version to 2017.12 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5140873bd08..3ee0e07c087 100644 --- a/composer.json +++ b/composer.json @@ -78,7 +78,7 @@ ] }, "conflict": { - "ezsystems/ezpublish-kernel": "<6.12 || >=2014.11 <2017.10" + "ezsystems/ezpublish-kernel": "<6.13 || >=2014.11 <2017.12" }, "extra": { "branch-alias": { From e25145277de3a453da350a304692657a97db2573 Mon Sep 17 00:00:00 2001 From: Benjamin Kroll Date: Fri, 22 Jun 2018 19:36:56 +1000 Subject: [PATCH 02/11] EZP-29210: Fix admin UI anchor link scroll bug (#1366) * Fix admin UI anchor link scroll bug - fixed height on the width controller element causes the user to get 'stuck' and unable to scroll back to the top when clicking on a link targeting an in page anchor The bug is also noted in this Jira ticket: https://jira.ez.no/browse/EZP-29210 * Fix admin UI anchor link scroll bug - removed widthcontrol-handler from user menu include template (admin) (cherry picked from commit a844df6a524698960a90d8430f403e46de1cd6f9) --- design/admin/stylesheets/pagelayout.css | 5 ++--- design/admin/templates/pagelayout.tpl | 3 +++ design/admin/templates/parts/content/menu.tpl | 5 ----- design/admin/templates/parts/media/menu.tpl | 5 ----- design/admin/templates/parts/my/menu.tpl | 5 ----- design/admin/templates/parts/setup/menu.tpl | 5 ----- design/admin/templates/parts/shop/menu.tpl | 5 ----- design/admin/templates/parts/user/menu.tpl | 6 ------ design/admin/templates/parts/visual/menu.tpl | 5 ----- 9 files changed, 5 insertions(+), 39 deletions(-) diff --git a/design/admin/stylesheets/pagelayout.css b/design/admin/stylesheets/pagelayout.css index a34334c1065..8fa008ecd5b 100644 --- a/design/admin/stylesheets/pagelayout.css +++ b/design/admin/stylesheets/pagelayout.css @@ -472,11 +472,10 @@ ul.leftmenu-items li.current a #widthcontrol-handler { position: absolute; - right: -30px; - top:-20px; + right: 20px; + top: 0; bottom: 0; /* strech div to full width of relative box */ width: 10px; - height: 5000px; cursor: col-resize; z-index:11; /* background: #f8f8f8;*/ diff --git a/design/admin/templates/pagelayout.tpl b/design/admin/templates/pagelayout.tpl index 7db0f7aa882..de01159c253 100644 --- a/design/admin/templates/pagelayout.tpl +++ b/design/admin/templates/pagelayout.tpl @@ -80,6 +80,9 @@ div#maincolumn {ldelim} padding-right: 20px; padding-left: 50px; {rdelim}
+
+
+
diff --git a/design/admin/templates/parts/content/menu.tpl b/design/admin/templates/parts/content/menu.tpl index 64e8329bbfc..d5c3aaed6df 100644 --- a/design/admin/templates/parts/content/menu.tpl +++ b/design/admin/templates/parts/content/menu.tpl @@ -55,8 +55,3 @@ {/switch}

- -{* This is the border placed to the left for draging width, js will handle disabling the one above and enabling this *} -
-
-
diff --git a/design/admin/templates/parts/media/menu.tpl b/design/admin/templates/parts/media/menu.tpl index 736d9e47eef..a3588a22ff3 100644 --- a/design/admin/templates/parts/media/menu.tpl +++ b/design/admin/templates/parts/media/menu.tpl @@ -54,8 +54,3 @@ {/switch}

- -{* This is the border placed to the left for draging width, js will handle disabling the one above and enabling this *} -
-
-
diff --git a/design/admin/templates/parts/my/menu.tpl b/design/admin/templates/parts/my/menu.tpl index 54674ec2661..4ddc38032e7 100644 --- a/design/admin/templates/parts/my/menu.tpl +++ b/design/admin/templates/parts/my/menu.tpl @@ -62,8 +62,3 @@ {/switch}

- -{* This is the border placed to the left for draging width, js will handle disabling the one above and enabling this *} -
-
-
diff --git a/design/admin/templates/parts/setup/menu.tpl b/design/admin/templates/parts/setup/menu.tpl index 00bc9ba7373..c41c4be32ae 100644 --- a/design/admin/templates/parts/setup/menu.tpl +++ b/design/admin/templates/parts/setup/menu.tpl @@ -69,8 +69,3 @@ {/switch}

- -{* This is the border placed to the left for draging width, js will handle disabling the one above and enabling this *} -
-
-
diff --git a/design/admin/templates/parts/shop/menu.tpl b/design/admin/templates/parts/shop/menu.tpl index 852ef99cf6b..344a5d71f45 100644 --- a/design/admin/templates/parts/shop/menu.tpl +++ b/design/admin/templates/parts/shop/menu.tpl @@ -45,8 +45,3 @@ {/switch}

- -{* This is the border placed to the left for draging width, js will handle disabling the one above and enabling this *} -
-
-
diff --git a/design/admin/templates/parts/user/menu.tpl b/design/admin/templates/parts/user/menu.tpl index 53b24e6344e..29b63cfbb77 100644 --- a/design/admin/templates/parts/user/menu.tpl +++ b/design/admin/templates/parts/user/menu.tpl @@ -82,10 +82,4 @@ {/switch}

- -{* This is the border placed to the left for draging width, js will handle disabling the one above and enabling this *} -
-
-
- {/if}{* if ne( $ui_context, 'edit' ) *} diff --git a/design/admin/templates/parts/visual/menu.tpl b/design/admin/templates/parts/visual/menu.tpl index f9f2069dbee..d57ce6af249 100644 --- a/design/admin/templates/parts/visual/menu.tpl +++ b/design/admin/templates/parts/visual/menu.tpl @@ -37,8 +37,3 @@ {/switch}

- -{* This is the border placed to the left for draging width, js will handle disabling the one above and enabling this *} -
-
-
From d626ecc8c725e5d7dbc85b37704f5ca142183b43 Mon Sep 17 00:00:00 2001 From: Gunnstein Lye Date: Fri, 22 Jun 2018 15:46:09 +0200 Subject: [PATCH 03/11] Fix regression which broke PASSWORD_HASH_MD5_PASSWORD (#1354) (cherry picked from commit 0ffed7d752f80f635f99ec3c690713a0f21f9526) --- kernel/classes/datatypes/ezuser/ezuser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/classes/datatypes/ezuser/ezuser.php b/kernel/classes/datatypes/ezuser/ezuser.php index 7f1b64b25b9..39bbaebe6fc 100644 --- a/kernel/classes/datatypes/ezuser/ezuser.php +++ b/kernel/classes/datatypes/ezuser/ezuser.php @@ -1812,7 +1812,11 @@ static function createHash( $user, $password, $site, $type, $hash = false ) $password = self::trimAuthString( $password ); $str = ''; - if( $type == self::PASSWORD_HASH_MD5_USER ) + if ( $type == self::PASSWORD_HASH_MD5_PASSWORD ) + { + $str = md5( $password ); + } + else if ( $type == self::PASSWORD_HASH_MD5_USER ) { $str = md5( "$user\n$password" ); } From 2ca0c7d71bba083e498e842969b529e9b51feedf Mon Sep 17 00:00:00 2001 From: Gunnstein Lye Date: Mon, 25 Jun 2018 16:16:21 +0200 Subject: [PATCH 04/11] EZP-29033: [Legacy] Don't remove links user has no access to (#1355) * EZP-29033: [Legacy] Don't remove links user has no access to * fixup! EZP-29033: [Legacy] Don't remove links user has no access to (cherry picked from commit 7814827a396b7333d380cb324b5cb226af42ec93) --- .../handlers/output/ezxhtmlxmloutput.php | 27 ++++++++++--------- settings/ezxml.ini | 3 +++ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php b/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php index 22990b3781b..ab2f46a7edf 100644 --- a/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php +++ b/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php @@ -187,6 +187,7 @@ function initHandlerHeader( $element, &$attributes, &$siblingParams, &$parentPar function initHandlerLink( $element, &$attributes, &$siblingParams, &$parentParams ) { $ret = array(); + $ezxmlIni = eZINI::instance('ezxml.ini'); // Set link parameters for rendering children of link tag $href=''; @@ -203,16 +204,16 @@ function initHandlerLink( $element, &$attributes, &$siblingParams, &$parentParam if ( $node != null ) { - if ( !$node->object()->canRead() ) + $view = $element->getAttribute( 'view' ); + if ( $view ) + $href = 'content/view/' . $view . '/' . $nodeID; + else if ( !$node->object()->canRead() && + $ezxmlIni->variable( 'ezxhtml', 'ShowURLAliasForProtectedLinks' ) !== 'enabled' ) { eZDebug::writeWarning( "Current user does not have read access to the object of node #$nodeID", 'XML output handler: link' ); - return $ret; + $href = 'content/view/full/' . $nodeID; } - - $view = $element->getAttribute( 'view' ); - if ( $view ) - $href = 'content/view/' . $view . '/' . $nodeID; else $href = $node->attribute( 'url_alias' ); } @@ -227,13 +228,6 @@ function initHandlerLink( $element, &$attributes, &$siblingParams, &$parentParam if ( isset( $this->ObjectArray["$objectID"] ) ) { $object = $this->ObjectArray["$objectID"]; - if ( !$object->canRead() ) - { - eZDebug::writeWarning( "Current user does not have read access to the object #$objectID", - 'XML output handler: link' ); - return $ret; - } - $node = $object->attribute( 'main_node' ); if ( $node ) { @@ -242,6 +236,13 @@ function initHandlerLink( $element, &$attributes, &$siblingParams, &$parentParam $view = $element->getAttribute( 'view' ); if ( $view ) $href = 'content/view/' . $view . '/' . $nodeID; + else if ( !$object->canRead() && + $ezxmlIni->variable( 'ezxhtml', 'ShowURLAliasForProtectedLinks' ) !== 'enabled' ) + { + eZDebug::writeWarning( "Current user does not have read access to the object #$objectID", + 'XML output handler: link' ); + $href = 'content/view/full/' . $nodeID; + } else $href = $node->attribute( 'url_alias' ); } diff --git a/settings/ezxml.ini b/settings/ezxml.ini index 6d8ad0d7ab5..a7d35b1e094 100644 --- a/settings/ezxml.ini +++ b/settings/ezxml.ini @@ -50,3 +50,6 @@ TagPresets[] # Determines to insert

tag inside a table cell in the output or not # if there is only one tag inside a cell. RenderParagraphInTableCells=enabled +# Show URL alias for links the current user does not have read access to. +# If disabled (recommended) the link will be /content/view/full/[nodeID] instead. +ShowURLAliasForProtectedLinks=disabled From 3c9982a52ebed1eccb63d76e9e05779d2f679a15 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Mon, 25 Jun 2018 10:21:23 -0400 Subject: [PATCH 05/11] Fix link source change (object => node) when editing a version (#1291) (cherry picked from commit 1e5fa83b8027e0536f897a580ff5e480e92af9c9) --- .../design/standard/templates/ezoe/customattributes/link.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/extension/ezoe/design/standard/templates/ezoe/customattributes/link.tpl b/extension/ezoe/design/standard/templates/ezoe/customattributes/link.tpl index 423ca450ce0..c3c887031fb 100644 --- a/extension/ezoe/design/standard/templates/ezoe/customattributes/link.tpl +++ b/extension/ezoe/design/standard/templates/ezoe/customattributes/link.tpl @@ -90,6 +90,7 @@ eZOEPopupUtils.settings.onInitDoneArray.push( function( editorElement ) ezoeLinkAttribute.timeOut = setTimeout( eZOEPopupUtils.BIND( ezoeLinkAttribute.ajaxCheck, this, url[0] + '_' + id, lid ), 320 ); return true; }); + inp.keyup(); // setup navigation on bookmark / browse / search links to their 'boxes' (panels) jQuery( 'a.atr_link_search_link, a.atr_link_browse_link, a.atr_link_bookmark_link' ).click( function(){ From 3f0b957fbb208834e965acad4ce5162e5f7cdcb3 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Mon, 25 Jun 2018 10:22:01 -0400 Subject: [PATCH 06/11] Update search index in hide cronjob (#1348) * Update search index in hide cronjob (cherry picked from commit 6f4e99fcd12e0ef70d41b7a74eb92d226a5177ab) --- cronjobs/hide.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cronjobs/hide.php b/cronjobs/hide.php index b4f71be915f..c831dd607df 100644 --- a/cronjobs/hide.php +++ b/cronjobs/hide.php @@ -49,6 +49,9 @@ { $cli->output( 'Hiding node: "' . $node->attribute( 'name' ) . '" (' . $node->attribute( 'node_id' ) . ')' ); eZContentObjectTreeNode::hideSubTree( $node ); + + //call appropriate method from search engine + eZSearch::updateNodeVisibility( $node->attribute( 'node_id' ), 'hide' ); } // clear memory after every batch eZContentObject::clearCache(); From 4849deacd5bdea06d84eb6c38308259d4831f245 Mon Sep 17 00:00:00 2001 From: Serhey Dolgushev Date: Thu, 28 Jun 2018 09:02:20 -0400 Subject: [PATCH 07/11] Force to use integer keys in eZXMLOutputHandler->NodeArray (#1356) (cherry picked from commit 4fcd80c575963097809df70539c99c46df4072b5) --- kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php | 4 ++-- .../datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php b/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php index d754dfbddb9..680cd474ca9 100644 --- a/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php +++ b/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php @@ -275,14 +275,14 @@ function prefetch() foreach( $nodes as $node ) { $nodeID = $node->attribute( 'node_id' ); - $this->NodeArray["$nodeID"] = $node; + $this->NodeArray[$nodeID] = $node; } } elseif ( $nodes ) { $node = $nodes; $nodeID = $node->attribute( 'node_id' ); - $this->NodeArray["$nodeID"] = $node; + $this->NodeArray[$nodeID] = $node; } } } diff --git a/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php b/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php index ab2f46a7edf..77ecf107b9d 100644 --- a/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php +++ b/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php @@ -199,7 +199,7 @@ function initHandlerLink( $element, &$attributes, &$siblingParams, &$parentParam } elseif ( $element->getAttribute( 'node_id' ) != null ) { - $nodeID = $element->getAttribute( 'node_id' ); + $nodeID = (int) $element->getAttribute( 'node_id' ); $node = isset( $this->NodeArray[$nodeID] ) ? $this->NodeArray[$nodeID] : null; if ( $node != null ) @@ -289,7 +289,7 @@ function initHandlerEmbed( $element, &$attributes, &$siblingParams, &$parentPara } else { - $nodeID = $element->getAttribute( 'node_id' ); + $nodeID = (int) $element->getAttribute( 'node_id' ); if ( $nodeID ) { if ( isset( $this->NodeArray[$nodeID] ) ) From f1d144415e2a7545e4acfc08fc35028696ac357b Mon Sep 17 00:00:00 2001 From: vnivuahc <25658540+vnivuahc@users.noreply.github.com> Date: Thu, 28 Jun 2018 15:03:42 +0200 Subject: [PATCH 08/11] Update index when adding/removing node assignment (#1353) In the back-end, when you add a new location to an existing content, or remove one, the search index is not updated. (cherry picked from commit d1ed2aaada4b3e36c2a91539832394407445a7cf) --- .../content/ezcontentoperationcollection.php | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/kernel/content/ezcontentoperationcollection.php b/kernel/content/ezcontentoperationcollection.php index f1432aedc08..373d99371dd 100644 --- a/kernel/content/ezcontentoperationcollection.php +++ b/kernel/content/ezcontentoperationcollection.php @@ -823,6 +823,11 @@ static public function addAssignment( $nodeID, $objectID, $selectedNodeIDArray ) eZContentCacheManager::clearContentCacheIfNeeded( $objectID ); + if ( !eZSearch::getEngine() instanceof eZSearchEngine ) + { + eZContentOperationCollection::registerSearchObject( $objectID ); + } + return array( 'status' => true ); } @@ -902,6 +907,13 @@ static public function removeNodes( array $removeNodeIdList ) { eZUser::purgeUserCacheByUserId( $object->attribute( 'id' ) ); } + + // Give other search engines that the default one a chance to reindex + // when removing locations. + if ( !eZSearch::getEngine() instanceof eZSearchEngine ) + { + eZContentOperationCollection::registerSearchObject( $objectId ); + } } // Triggering content/cache filter for Http cache purge @@ -1125,6 +1137,10 @@ static public function swapNode( $nodeID, $selectedNodeID, $nodeIdList = array() // clear cache for new placement. eZContentCacheManager::clearContentCacheIfNeeded( $objectID ); + if ( !eZSearch::getEngine() instanceof eZSearchEngine ) + { + eZContentOperationCollection::registerSearchObject( $objectID ); + } eZSearch::swapNode( $nodeID, $selectedNodeID, $nodeIdList = array() ); @@ -1256,11 +1272,14 @@ static public function updatePriority( $parentNodeID, $priorityArray = array(), * * @return array An array with operation status, always true */ - static public function updateMainAssignment( $mainAssignmentID, $ObjectID, $mainAssignmentParentID ) + static public function updateMainAssignment( $mainAssignmentID, $objectID, $mainAssignmentParentID ) { - eZContentObjectTreeNode::updateMainNodeID( $mainAssignmentID, $ObjectID, false, $mainAssignmentParentID ); - eZContentCacheManager::clearContentCacheIfNeeded( $ObjectID ); - eZContentOperationCollection::registerSearchObject( $ObjectID ); + eZContentObjectTreeNode::updateMainNodeID( $mainAssignmentID, $objectID, false, $mainAssignmentParentID ); + eZContentCacheManager::clearContentCacheIfNeeded( $objectID ); + if ( !eZSearch::getEngine() instanceof eZSearchEngine ) + { + eZContentOperationCollection::registerSearchObject( $objectID ); + } return array( 'status' => true ); } From 3b24b8aafe037e4876aa15c3432235b9eba73c1e Mon Sep 17 00:00:00 2001 From: Ole Morten Halvorsen Date: Thu, 28 Jun 2018 15:03:58 +0200 Subject: [PATCH 09/11] Fixed fatal error (#1367) `continue` used outside of loop. (cherry picked from commit 582e393052c190812064a5fc91bcb848c80d789a) --- update/common/scripts/5.4/fixtrashedimagereferences.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/common/scripts/5.4/fixtrashedimagereferences.php b/update/common/scripts/5.4/fixtrashedimagereferences.php index 832a88734a3..031b05b88c5 100644 --- a/update/common/scripts/5.4/fixtrashedimagereferences.php +++ b/update/common/scripts/5.4/fixtrashedimagereferences.php @@ -64,7 +64,7 @@ function fixupTrashedImageXml( $imageAttribute, $optDryRun ) eZCLI::instance()->notice( "Processing image $contentId ($version) ..." ); if ( ( $doc = simplexml_load_string( $imageAttribute['data_text'] ) ) === false ) - continue; + return; $doc['filename'] = ''; $doc['basename'] = ''; From 5e55dd92e32bf77244264c5c13833479ec810711 Mon Sep 17 00:00:00 2001 From: Elise Kristiansen Date: Fri, 29 Jun 2018 09:00:31 +0200 Subject: [PATCH 10/11] Fixed php7 warning (#1370) * Fixed php7 warning ErrorException (E_WARNING) Illegal string offset 'path' * Moved declaration of $Result to top of case (cherry picked from commit 69c2f36125f441a263194ac3ac9ab4e6d835ca75) --- kernel/content/edit.php | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/content/edit.php b/kernel/content/edit.php index 915f93b4135..4f729c43441 100644 --- a/kernel/content/edit.php +++ b/kernel/content/edit.php @@ -765,6 +765,7 @@ function computeRedirect( $module, $object, $version, $EditLanguage = false ) } else if ( isset( $operationResult['result'] ) ) { + $Result = array(); $result = $operationResult['result']; $resultContent = false; if ( is_array( $result ) ) From 2cce17cd60f8ac391974c7287148396402736eb5 Mon Sep 17 00:00:00 2001 From: Ole Morten Halvorsen Date: Fri, 29 Jun 2018 10:29:36 +0200 Subject: [PATCH 11/11] Make query compatible with strict MySQL (#1368) MySQL 5.7 is strict by default and will error out on the incorrect GROUP BY. (cherry picked from commit 28fadf953a37ae4b3e138d1b9141b0c7b78999fc) --- update/common/scripts/5.4/cleanuntranslatablerelations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/common/scripts/5.4/cleanuntranslatablerelations.php b/update/common/scripts/5.4/cleanuntranslatablerelations.php index a5e8fed711b..7a4cde2b323 100644 --- a/update/common/scripts/5.4/cleanuntranslatablerelations.php +++ b/update/common/scripts/5.4/cleanuntranslatablerelations.php @@ -82,7 +82,7 @@ function parseRelationListIds( $relationListXml ) "FROM ezcontentobject_attribute attr ". "INNER JOIN ezcontentclass_attribute classattr ON attr.contentclassattribute_id=classattr.id " . "WHERE classattr.data_type_string IN ( 'ezobjectrelation', 'ezobjectrelationlist' ) AND can_translate=0 " . - "GROUP BY contentobject_id, version, data_int" + "GROUP BY contentobject_id, version, data_int, attr_id, classattr.data_type_string, attr.data_text" ); $count = count($rows);