dolibarr/htdocs/core/modules
Frédéric FRANCE 1cafc092df
pdf logo header mutualization (#39503)
* FIX: Restore PHPUnit 11 compatibility in CommonClassTest

onNotSuccessfulTest() overrode PHPUnit\Framework\TestCase's method with
an incompatible return type (void vs never), and the assertMatchesRegularExpression
back-compat shim for PHPUnit <8 now illegally overrides that method, which
PHPUnit 11 declares final. Both faults made every test extending
CommonClassTest fatal immediately on this environment's PHPUnit 11.5.55.
Pre-existing breakage, unrelated to the PDF mutualization work in this
branch — fixed here because Task 1's plan requires a passing
BuildDocTest.php baseline before any implementer is dispatched.

* NEW: Mutualize PDF header logo block into pdf_writeLogoOrCompanyName() (sponge, einstein, azur, muscadet)

* NEW: Mutualize PDF header logo block into pdf_writeLogoOrCompanyName() (cornas, standard, cyan, octopus, strato)

* FIX: Resolve $logodir before calling pdf_writeLogoOrCompanyName() in cornas, standard, cyan, octopus, strato

* NEW: Mutualize PDF header logo block into pdf_writeLogoOrCompanyName() (eratosthene, eagle_proforma, standard_asset)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* NEW: Mutualize PDF header logo block into pdf_writeLogoOrCompanyName() (aurore, zenith)

* FIX: Complete PHPUnit 11 compatibility fix in CommonClassTest::onNotSuccessfulTest

The prior compatibility fix (f29129aae43) resolved the two class-load
fatals but left onNotSuccessfulTest() calling getName()/getDataSetAsString(),
neither of which exists on PHPUnit 11's TestCase (renamed to name() and
dataSetAsStringWithData()/dataSetAsString()). The undefined-method error
was silently absorbed by PHPUnit's own exception handling, so every test
failure across the suite still ran and reported correctly, but the
method's entire diagnostic block (log tail, backtrace, DB info dump) never
executed. Verified with a throwaway reproduction test before and after:
the diagnostic ##[group] output was empty before this fix and complete
after it.

Found during the final whole-branch review of the PDF logo-block
mutualization branch; unrelated to that refactor but touches the same
file already modified by the earlier compatibility commit.

* FIX: Drop unneeded by-ref $pdf and rename $ltrdirection to $align in pdf_writeLogoOrCompanyName()

TCPDF objects are handles, so passing $pdf by reference bought nothing
and was inconsistent with every sibling function in this file
(pdf_pagehead, pdf_watermark, pdf_bank, pdf_pagefoot, ...), all of which
take $pdf by value. $ltrdirection was also a misnomer: three of the 14
callers pass the literal 'L' and one passes 'J' (justify) - none of those
is a text direction, it's an alignment. Renaming is call-site-transparent
(all 14 callers use positional arguments).

Found during the final whole-branch review of the PDF logo-block
mutualization branch.

* NEW: Document pdf_writeLogoOrCompanyName() helper in ChangeLog

Per repo convention (CLAUDE.md: "Always update ChangeLog for
significant changes"). Flagged during the final whole-branch review
of the PDF logo-block mutualization branch: a new reusable pdf_lib.php
function is part of the surface third-party PDF document-model modules
build against.

* restore commonclasstest

* fix

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-19 02:37:18 +02:00
..
accountancy Document metadata anonymisation (followup of PR #38116) (#38120) 2026-05-07 17:52:55 +02:00
action Qual: Fix 'SqlInjection' notices (#39224) 2026-07-20 02:51:54 +02:00
asset pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
bank FIX|Fix #34947 PDF top margin breaks layout in multiple templates (#35919) 2026-07-20 00:09:32 +02:00
barcode Qual: Fix 'SqlInjection' notices (#39232) 2026-08-01 23:54:52 +02:00
bom Qual: Fix 'SqlInjection' notices (#39231) 2026-07-20 15:28:15 +02:00
cheque Qual: Fix 'SqlInjection' notices (#39231) 2026-07-20 15:28:15 +02:00
commande pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
contract pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
delivery Qual: Fix 'SqlInjection' notices (#39231) 2026-07-20 15:28:15 +02:00
dons Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 24.0 2026-08-14 15:54:52 +02:00
expedition Qual: Fix 'SqlInjection' notices (#39231) 2026-07-20 15:28:15 +02:00
expensereport Fix: Update type hints in PDF modules (#39226) 2026-07-24 04:13:07 +02:00
export Automated merge from 23.0 to develop 2026-07-15 02:06:09 +02:00
facture pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
fichinter Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
holiday fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
hrm Fix: Update type hints in PDF modules (#39226) 2026-07-24 04:13:07 +02:00
import Qual: Remove SQL injection suppressions from Phan baseline (#39450) 2026-08-11 02:21:54 +02:00
mailings Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
member Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
movement Document metadata anonymisation (followup of PR #38116) (#38120) 2026-05-07 17:52:55 +02:00
mrp Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
oauth Fix redirect after oauth 2026-05-30 01:44:23 +02:00
openid_connect
payment Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
printing Merge 2026-06-12 19:25:23 +02:00
printsheet Document metadata anonymisation (followup of PR #38116) (#38120) 2026-05-07 17:52:55 +02:00
product pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
product_batch Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
project Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
propale pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
rapport Qual: Fix 'SqlInjection' notices (#39225) 2026-07-20 02:52:07 +02:00
reception Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
salaries Qual: Fix phan notices (#37837) 2026-04-13 12:50:23 +02:00
security NEW: #0 Resolve password generator/validator classes via modules_parts['models'] (#39486) 2026-08-14 16:19:48 +02:00
societe Qual: Fix 'SqlInjection' notices (#39232) 2026-08-01 23:54:52 +02:00
stock FIX|Fix #34947 PDF top margin breaks layout in multiple templates (#35919) 2026-07-20 00:09:32 +02:00
stocktransfer pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
supplier_invoice Clean code 2026-08-07 14:26:51 +02:00
supplier_order pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
supplier_payment Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
supplier_proposal pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
syslog Qual: Fix phan notices (#39354) 2026-08-04 16:40:20 +02:00
takepos Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
ticket Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
user
usergroup Qual: Fix PHPStan messages (#38053) 2026-05-07 14:20:03 +02:00
workstation Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
DolibarrModules.class.php Qual: Remove unnecessary quotes around integer values in SQL queries (#39290) 2026-07-27 12:59:14 +02:00
modAccounting.class.php Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-18 16:17:03 +02:00
modAdherent.class.php Qual: Fix 'SqlInjection' notices (#39222) 2026-07-20 02:51:25 +02:00
modAgenda.class.php Qual: Fix 'SqlInjection' notices (#39220) 2026-07-20 02:51:00 +02:00
modAi.class.php New: granular right for AI Assistant usage (#38312) 2026-06-11 09:33:14 +02:00
modApi.class.php Fix editing api key must follow same permissions than editing password. 2026-08-07 18:41:23 +02:00
modAsset.class.php
modBanque.class.php NEW - Various payments - Add extrafield (#38260) 2026-05-18 03:27:35 +02:00
modBarcode.class.php
modBlockedLog.class.php Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-18 16:17:03 +02:00
modBom.class.php Qual: Fix 'SqlInjection' notices (#39228) 2026-07-20 15:26:30 +02:00
modBookCal.class.php
modBookmark.class.php
modCategorie.class.php Automated merge from 23.0 to develop 2026-07-15 02:06:09 +02:00
modClickToDial.class.php
modCollab.class.php
modCommande.class.php Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
modComptabilite.class.php
modContrat.class.php
modCron.class.php
modDataPolicy.class.php clean code and fix phpstan (#37831) 2026-04-12 11:59:56 +02:00
modDav.class.php clean code (#38826) 2026-06-15 14:57:01 +02:00
modDebugBar.class.php
modDocumentGeneration.class.php
modDon.class.php
modDynamicPrices.class.php
modECM.class.php
modEmailCollector.class.php Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
modEventOrganization.class.php Qual: Fix 'SqlInjection' notices (#39224) 2026-07-20 02:51:54 +02:00
modExpedition.class.php Qual: Fix 'SqlInjection' notices (#39232) 2026-08-01 23:54:52 +02:00
modExpenseReport.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modExport.class.php
modExternalRss.class.php Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
modFacture.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modFckeditor.class.php
modFicheinter.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modFournisseur.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modFTP.class.php clean code and fix phpstan (#37831) 2026-04-12 11:59:56 +02:00
modGeoIPMaxmind.class.php
modGravatar.class.php
modHoliday.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modHRM.class.php
modImport.class.php
modIncoterm.class.php
modIntracommreport.class.php
modKnowledgeManagement.class.php Qual: Fix 'SqlInjection' notices (#39228) 2026-07-20 15:26:30 +02:00
modLabel.class.php
modLdap.class.php clean code and fix phpstan (#37831) 2026-04-12 11:59:56 +02:00
modLoan.class.php clean code and fix phpstan (#37831) 2026-04-12 11:59:56 +02:00
modMailing.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modMailmanSpip.class.php
modMargin.class.php
modModuleBuilder.class.php
modMrp.class.php Qual: Fix 'SqlInjection' notices (#39228) 2026-07-20 15:26:30 +02:00
modMultiCurrency.class.php
modNotification.class.php
modOauth.class.php
modOpenSurvey.class.php
modPartnership.class.php Qual: Fix 'SqlInjection' notices (#39232) 2026-08-01 23:54:52 +02:00
modPaymentByBankTransfer.class.php Automated merge from 23.0 to develop 2026-07-15 02:06:09 +02:00
modPaypal.class.php
modPrelevement.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modPrinting.class.php
modProduct.class.php Qual: Fix 'SqlInjection' notices (#39219) 2026-07-20 02:50:44 +02:00
modProductBatch.class.php avoid fatal errors (#37856) 2026-04-14 02:55:19 +02:00
modProjet.class.php Qual: Fix 'SqlInjection' notices (#39219) 2026-07-20 02:50:44 +02:00
modPropale.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modQuickMemo.class.php Doc 2026-06-19 15:04:58 +02:00
modReceiptPrinter.class.php
modReception.class.php Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 24.0 2026-08-13 17:16:49 +02:00
modRecruitment.class.php Qual: Fix 'SqlInjection' notices (#39232) 2026-08-01 23:54:52 +02:00
modResource.class.php Qual: Fix 'SqlInjection' notices (#39228) 2026-07-20 15:26:30 +02:00
modSalaries.class.php fix phpstan (#37823) 2026-04-11 17:40:53 +02:00
modService.class.php Qual: Fix 'SqlInjection' notices (#39230) 2026-07-20 15:28:26 +02:00
modSocialNetworks.class.php
modSociete.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modStock.class.php fix CI in v23 (#39439) 2026-08-11 02:13:43 +02:00
modStockTransfer.class.php Qual: Fix PHPStan notices (#37967) 2026-04-23 14:57:54 +02:00
modStripe.class.php
modSubtotals.class.php FIX install crash when loading subtotals module (#38244) 2026-05-18 03:03:11 +02:00
modSupplierInvoice.class.php Qual: Fix 'SqlInjection' notices (#39224) 2026-07-20 02:51:54 +02:00
modSupplierOrder.class.php Qual: Fix 'SqlInjection' notices (#39222) 2026-07-20 02:51:25 +02:00
modSupplierProposal.class.php Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 24.0 2026-08-13 17:16:49 +02:00
modSyslog.class.php
modTakePos.class.php Doc 2026-06-06 00:52:09 +02:00
modTax.class.php clean code and fix phpstan (#37831) 2026-04-12 11:59:56 +02:00
modTicket.class.php Fix option to show statistics pages in menu. 2026-07-09 23:37:45 +02:00
modUser.class.php Qual: Fix 'SqlInjection' notices (#39228) 2026-07-20 15:26:30 +02:00
modVariants.class.php
modWebhook.class.php
modWebPortal.class.php
modWebServices.class.php
modWebsite.class.php
modWorkflow.class.php
modWorkstation.class.php Qual: Fix 'SqlInjection' notices (#39232) 2026-08-01 23:54:52 +02:00
modZapier.class.php