Standardize trigger codes

This commit is contained in:
Laurent Destailleur 2024-10-14 14:05:20 +02:00
parent be4b8efebd
commit 73265e45ab
2 changed files with 28 additions and 29 deletions

View File

@ -2,6 +2,31 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 21.0.0 compared to 20.0 *****
For users:
----------
NEW Add option THEME_STICKY_TOPMENU = 'scrollleftmenu_after_mainpage' (or 'disabled')
NEW value for FICHINTER_DISABLE_DETAILS. If FICHINTER_DISABLE_DETAILS is set to '2' details are disabled only on intervention list.
For developers:
---------------
WARNING:
--------
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Prepare your module for deprecation of triggers code XXX_INSERT to support also XXX_CREATE.
* More class properties (with old name in french) are now deprecated in favor of the property name in english.
* The json emulator dol_json_encode/decode() is removed. The native json PHP module must be enabled/available (this is the case by default with most PHP installation).
* The experimental and deprecated module WebserviceClient is completely removed (SOAP technology is deprecated). May be replaced with the stable module Webhook.
* The dynamic properties ->no_button_delete, ->no_button_edit, ->no_button_copy for $object Product that could be set by an external module must no more
be set (not allowed by PHP 8.2). A module can already return an array with key 'no_button_delete', 'no_button_edit', 'no_button_copy' for same purpose.
* The old function dol_bc($var, $moreclass = '') has been removed. If you called it, just stop to call it.
* The trigger code CATEGORY_LINK and CATEGORY_UNLINK has been replaced with code CATEGORY_MODIFY. You can read ->context['linkto'] or ->context['unlinkoff' to detect we want to make a link or unlink.
***** ChangeLog for 20.0.1 compared to 20.0.0 *****
FIX: #30960 show and search extrafields (#31026)
@ -52,32 +77,6 @@ FIX: when qty is not an integer, apply price() (#31138)
FIX: Wrong price for BOM with workstation (#31142)
FIX: determine multi-currency price on object line create tpl (#28021)
***** ChangeLog for 21.0.0 compared to 20.0 *****
For users:
----------
NEW Add option THEME_STICKY_TOPMENU = 'scrollleftmenu_after_mainpage' (or 'disabled')
NEW value for FICHINTER_DISABLE_DETAILS. If FICHINTER_DISABLE_DETAILS is set to '2' details are disabled only on intervention list.
For developers:
---------------
WARNING:
--------
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Prepare your module for deprecation of triggers code XXX_INSERT to support also XXX_CREATE.
* More class properties (with old name in french) are now deprecated in favor of the property name in english.
* The json emulator dol_json_encode/decode() is removed. The native json PHP module must be enabled/available (this is the case by default with most PHP installation).
* The experimental and deprecated module WebserviceClient is completely removed (SOAP technology is deprecated). May be replaced with the stable module Webhook.
* The dynamic properties ->no_button_delete, ->no_button_edit, ->no_button_copy for $object Product that could be set by an external module must no more
be set (not allowed by PHP 8.2). A module can already return an array with key 'no_button_delete', 'no_button_edit', 'no_button_copy' for same purpose.
* The old function dol_bc($var, $moreclass = '') has been removed. If you called it, just stop to call it.
***** ChangeLog for 20.0.0 compared to 19.0 *****
For users:

View File

@ -459,7 +459,7 @@ class Categorie extends CommonObject
*/
public function create($user, $notrigger = 0)
{
global $conf, $langs, $hookmanager;
global $conf, $langs;
$langs->load('categories');
$type = $this->type;
@ -809,7 +809,7 @@ class Categorie extends CommonObject
// Call trigger
$this->context = array('linkto' => $obj); // Save object we want to link category to into category instance to provide information to trigger
$result = $this->call_trigger('CATEGORY_LINK', $user);
$result = $this->call_trigger('CATEGORY_MODIFY', $user);
if ($result < 0) {
$error++;
}
@ -869,7 +869,7 @@ class Categorie extends CommonObject
if ($this->db->query($sql)) {
// Call trigger
$this->context = array('unlinkoff' => $obj); // Save object we want to link category to into category instance to provide information to trigger
$result = $this->call_trigger('CATEGORY_UNLINK', $user);
$result = $this->call_trigger('CATEGORY_MODIFY', $user);
if ($result < 0) {
$error++;
}