FIX: doc preview loupe on shipments (BL) in comm card#755
Merged
Conversation
On the thirdparty card (client/prospect tab), the PDF preview magnifier of
a shipment (BL) pointed to document.php?modulepart=shipping. The security
check dol_check_secure_access_document() only handles 'expedition'/'shipment'
('shipping' is just a module-name alias; files live under the 'expedition'
directory), so it fell through to the generic branch and raised
dol_print_error "not supported value for modulepart parameter (shipping)",
shown in production as the generic "temporarily not available" page.
Pass the 'expedition' modulepart (same as expedition/document.php) instead of
$sendingstatic->element ('shipping'), and add the missing entity parameter
like the other lists. Drop the now-unused $param.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wrap the shipment (BL) doc-preview fix in comm/card.php with the /**DEBUT/FIN SPECIFIQUE ATM **/ markers so the divergence from core is isolated and merges cleanly on future core upgrades. The original core line is kept as a comment for reference. Add the corresponding line to ChangeLogAtm.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptôme
Sur la fiche tiers (onglet Client/Prospect), cliquer sur la loupe d'aperçu PDF d'un BL renvoie la page générique de prod « This website or feature is currently temporarily not available… ». L'aperçu du même BL reste accessible depuis sa page dédiée.
Cause racine
comm/card.phppassait$sendingstatic->element(="shipping") commemodulepartàshowPreview()→document.php?modulepart=shipping. Ordol_check_secure_access_document()(core/lib/files.lib.php~3401) ne gère queexpedition/shipment;shippingn'est qu'un alias de nom de module (MODULE_MAPPING:'expedition' => 'shipping', les fichiers sont stockés sousexpedition/sending/). Lemodulepart=shippingtombe dans la branche générique, teste$conf->shipping->dir_output(vide) →dol_print_error("not supported value for modulepart parameter (shipping)")+ exit → masqué en prod.Les 5 autres listes (devis, commandes, factures, contrats, interventions) fonctionnent car leur
->elementcorrespond déjà à unmodulepartvalide. Seule l'Expédition aelement(shipping) ≠modulepart(expedition). Les pages dédiées marchent car elles utilisent en durmodulepart='expedition'(expedition/document.php:196).Correctif
modulepart'expedition'(comme la page dédiée) au lieu de$sendingstatic->element.entityqui manquait sur cette liste (multi-société), comme les autres listes.$param = ''devenu inutile.Même famille que la PR Dolibarr#37057 (
FIX/docPreviewInCommCard), qui avait ajoutéentity=aux listes sœurs mais laissé le bug demodulepartdu BL.Portée
1 fichier, 2 lignes (
htdocs/comm/card.php, bloc « Latest shipments »). Aucune migration, aucun effet de bord sur les autres listes.php -lOK.