#962 [Hook] fix: keep the project tooltip layout on the projects only - #963
Open
evarisk-kilyan wants to merge 1 commit into
Open
evarisk-kilyan wants to merge 1 commit into
evarisk-kilyan wants to merge 1 commit into
Conversation
… only The contexts of a page pile up in the hookmanager, so the 'projectdao' registered by the first Project::getNomUrl() stayed set for every tooltip built afterwards, whatever its object. On the CardPro of a third party, the proposals listed next to the projects were therefore rebuilt with the project layout: an "OpportunityAmount 0,00 €" added on the picto row — untranslated, Propal::getTooltipContentArray() loading 'propal' and not 'projects' —, a reformatted ref line and the extrafields "..." dropped. The tooltip is now recognised on the object itself, which also applies the layout to the first project link of a page, and 'projects' is loaded up front for the labels.
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.
Closes #962
Problème
Sur la CardPro d'un tiers, l'infobulle d'une proposition commerciale affichait
OpportunityAmount 0,00 €non traduit, alors que la même mention est bien traduite sur les projets.Cause
Les contextes d'une page s'empilent dans le
hookmanager(contextarrayest cumulatif). LeinitHooks(array('projectdao'))fait parProject::getNomUrl()restait donc actif pour toutes les infobulles construites ensuite, quel que soit leur objet.Le hook
getTooltipContentde ReedCRM ne testait que ce contexte : sur la CardPro, les propositions listées à côté des projets étaient reconstruites avec la mise en page projet — montant d'opportunité ajouté sur la ligne du picto, ligne de réf. reformatée,...des extrafields supprimé. Et commePropal::getTooltipContentArray()chargepropalet pasprojects, la cléOpportunityAmountrestait brute.À l'inverse,
projectdaon'étant enregistré qu'en fin degetNomUrl(), la première infobulle projet d'une page n'était jamais mise en page.Correctif
La reconnaissance se fait maintenant sur l'objet lui-même (
$object->element === 'project'), etprojectsest chargé en début de bloc pour les libellés.Tests
Infobulles rendues en CLI avec
projectdaodéjà présent dans le contexte (cas de la CardPro) :Avant
Après
L'infobulle projet est inchangée (montant d'opportunité, ref + dates, libellé, description).