phpbb\attachment\delete.php
При разбиении на функции захватили лишнее событие, в
core.delete_attachments_before
ничего не передаётся (что приводит к ошибкам в расширениях)
Решение:
Перенести кусок кода
Код: Выделить всё
/**
* Perform additional actions before attachment(s) deletion
*
* @event core.delete_attachments_before
* @var string mode Variable containing attachments deletion mode, can be: post|message|topic|attach|user
* @var mixed ids Array or comma separated list of ids corresponding to the mode
* @var bool resync Flag indicating if posts/messages/topics should be synchronized
* @var string sql_id The field name to collect/delete data for depending on the mode
* @var array post_ids Array with post ids for deleted attachment(s)
* @var array topic_ids Array with topic ids for deleted attachment(s)
* @var array message_ids Array with private message ids for deleted attachment(s)
* @var array physical Array with deleted attachment(s) physical file(s) data
* @since 3.1.7-RC1
*/
$vars = array(
'mode',
'ids',
'resync',
'sql_id',
'post_ids',
'topic_ids',
'message_ids',
'physical',
);
extract($this->dispatcher->trigger_event('core.delete_attachments_before', compact($vars)));
Перед
Код: Выделить всё
// Delete attachments from database
$this->delete_attachments_from_db();
в том же файле
--------
Плюс в события в общем не передаются все нужные переменные
Проблема с переменной
sql_id
в событиях
core.delete_attachments_collect_data_before
,
core.delete_attachments_before
,
core.delete_attachments_from_database_after
,
core.delete_attachments_from_filesystem_after
решается добавлением до каждого события строки
$sql_id = $this->sql_id;
, после события -
$this->sql_id = $sql_id;
Есть ещё проблемы с другими переменными, но в них не разбиралась