Wir verwenden bei einem Projekt zur Verbesserung der Performance Hooks um eine recht "schwere" Übersichtsseite bei atomaren Änderungen der einzelnen Einträge (= Objekte) neu generieren zu lassen. Die Übersichtsseite besteht im Wesentlichen aus einer Listview die eine Übersicht über alle verfügbaren Objekte erstellt.
Die Hooks (publish, unpublish, delete) schauen wie folgt aus:
Code: Alles auswählen
function weCustomHook_publish($param){
$obj = $param[0];
switch (get_class($obj)) {
case 'we_objectFile':
// If this is an object of class "Organisation" (1), regenerate the static index.
if($obj->TableID == '1') {
// re-publish index
$docIndex = new we_webEditionDocument();
$docIndex->initByID(1);
$docIndex->we_save();
$docIndex->we_publish();
}
break;
default:
return true;
break;
}
}
- Beim Publizieren/Depublizieren springt der Tab auf das Übersicht-Dokument um. Das Objekt muss zur Bearbeitung erneut geöffnet werden.
- Das Löschen von betroffenen Objekten funktioniert nicht mehr.
Code: Alles auswählen
ID: 19
--------------------------------------------------------------------------------
Type: Error
--------------------------------------------------------------------------------
Function: -
--------------------------------------------------------------------------------
File: SECURITY_REPL_DOC_ROOT/webEdition/we/include/we_tags/we_tag_field.inc.php
--------------------------------------------------------------------------------
Line: 338
--------------------------------------------------------------------------------
Text: Call to a member function getFieldByVal() on null
--------------------------------------------------------------------------------
Backtrace: #0 DOCUMENT_ROOT/webEdition/we/include/we_tag.inc.php(141): we_tag_field(Array, '', false)
#1 DOCUMENT_ROOT/webEdition/we/templates/includes/organization_index.inc.php: we_tag('field', Array)
#2 DOCUMENT_ROOT/webEdition/we/include/we_classes/contents/we_webEditionDocument.class.php(753): include('...')
#3 DOCUMENT_ROOT/webEdition/we/include/we_classes/contents/we_webEditionDocument.class.php(850): we_webEditionDocument->i_getDocument()
#4 DOCUMENT_ROOT/webEdition/we/include/we_classes/contents/we_document.class.php(723): we_webEditionDocument->i_getDocumentToSave()
#5 DOCUMENT_ROOT/webEdition/we/include/we_classes/contents/we_webEditionDocument.class.php(686): we_document->i_writeDocument()
#6 DOCUMENT_ROOT/webEdition/we/include/we_classes/contents/we_textContentDocument.class.php(409): we_webEditionDocument->i_writeDocument()
#7 DOCUMENT_ROOT/webEdition/we/include/we_classes/contents/we_textContentDocument.class.php(266): we_textContentDocument->i_saveTmp(true)
#8 DOCUMENT_ROOT/webEdition/we/include/we_classes/contents/we_webEditionDocument.class.php(660): we_textContentDocument->we_save(false, false)
#9 DOCUMENT_ROOT/webEdition/we/include/we_hook/custom_hooks/weCustomHook_delete.inc.php(39): we_webEditionDocument->we_save()
#10 DOCUMENT_ROOT/webEdition/we/include/we_hook/class/weHook.class.php(59): weCustomHook_delete(Array)
#11 DOCUMENT_ROOT/webEdition/we/include/we_classes/base/we_base_delete.class.php(261): weHook->executeHook()
#12 DOCUMENT_ROOT/webEdition/we/include/we_delete.inc.php(268): we_base_delete::deleteEntry(4759, 'tblObjectFiles', true, false, Object(DB_WE))
#13 DOCUMENT_ROOT/webEdition/we_cmd.php(314): require('...')
#14 {main}
--------------------------------------------------------------------------------
Date: 2017-12-12 15:20:23
--------------------------------------------------------------------------------
Source-Code: webEdition/we/include/we_tags/we_tag_field.inc.php:
337: default:
338: $normVal = $GLOBALS['we_doc']->getFieldByVal($GLOBALS['lv']->f($name), $testtype, $attribs, false, $GLOBALS['we_doc']->ParentID, $GLOBALS['we_doc']->Path, $GLOBALS['DB_WE'], $classid, 'listview');
339: if($orgName === 'WE_PATH'){
340: $path_parts = pathinfo($normVal);
341: if(!$GLOBALS['WE_MAIN_DOC']->InWebEdition && !empty($GLOBALS['lv']->hidedirindex) && seoIndexHide($path_parts['basename'])){
342: $normVal = ($path_parts['dirname'] != '/' ? $path_parts['dirname'] : '') . '/';
----------------------------------------------------------
--------------------------------------------------------------------------------
WE-Info:
Version: 7.0.4.0
SVN: 14222 trunk release h0
--------------------------------------------------------------------------------
System:
PHP: 7.0.20
max_execution_time: 300
memory_limit: 512M
short_open_tag:
post_max_size: 20M
max_input_vars: 5000
session.auto_start:
--------------------------------------------------------------------------------
Mysql:
type: mysqli_connect
protocol: 10
client: mysqlnd 5.0.12-dev - 20150407 - $Id: *** $
host: *** via TCP/IP
server: 5.6.19-67.0-log
database: ***
encoding: utf8
Liebe Grüße,
Sascha