dolibarr/htdocs/societe/canvas
Jam Balaya 217e32c6c1
FIX: undefined $objcanvas/$socid in societe thirdparty canvas templates (#39116)
Canvas::display_canvas() (htdocs/core/class/canvas.class.php) includes these
templates from inside a method and only imports $db,$conf,$langs,$user,
$canvas,$form,$formfile via 'global'. $objcanvas and $socid are never
brought into that scope, so they were undefined at runtime (the templates
already reconstruct the thirdparty object from $GLOBALS['objcanvas']).

- Derive $socid from the in-scope thirdparty object ($soc->id / $object->id),
  fixing the empty socid used for $filedir/$urlsource/showdocuments().
- Replace the bare $objcanvas->control->object with the already-derived $soc
  (company) / $object (individual).

For the company template $socid was previously masked from PHPStan by a
'@var int $socid' docblock; it is now actually defined.
2026-07-11 14:19:44 +02:00
..
company FIX: undefined $objcanvas/$socid in societe thirdparty canvas templates (#39116) 2026-07-11 14:19:44 +02:00
individual FIX: undefined $objcanvas/$socid in societe thirdparty canvas templates (#39116) 2026-07-11 14:19:44 +02:00
actions_card_common.class.php don't take care of some french comments and fix false positive (#39007) 2026-06-29 19:28:28 +02:00
README

This directory contains an example on how we can use
the canvas feature to overwrite the thirdparty screen and
sql code by new one.

This directory is used only if thirdpartie's pages are called
with option canvas=newcanvas@societe parameter.
If yes, screens are replaced by template in
htdocs/societe/canvas/newcanvas directory
and actions are also replaced by actions in
htdocs/societe/canvas/newcanvas directory.

In standard usage of Dolibarr, this directory can be removed.