Projet

Général

Profil

Anomalie #1728

Limitations of the API for dynamic tags

Ajouté par thomas - il y a environ 10 ans. Mis à jour il y a plus de 9 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
filtres et balises
Version cible:
-
Début:
Echéance:
% réalisé:

0%

Resolution:
fixed
Navigateur:

Description

Fil asked me to post a ticket about <http://passingcuriosity.com/2009/dynamic-tags-fake-arguments-ast-mangling-in-spip/&gt;.

I'm trying to pass information from the Champ object $p given to balise_MY_TAG() to balise_MY_TAG_stat(). The only way I can see to pass information like this is to add a new Texte object to $p->param. If this is the correct technique, I think that SPIP should include a function to "add a new parameter to an AST object".

If this is not the correct way to pass information into the balise_*_stat() and balise_*_dyn() functions, then I think that calculer_balise_dynamique() needs to take an array of "extra data" as a fourth parameter.

I've attached a patch that makes this change. The patch did what I expect it to, but I haven't tested it too much -- I'm not familiar enough with SPIP's internals to tell what it could break.

calculer_balise_dynamique.diff Voir - Patch modifying calculer_balise_dynamique (948 octets) thomas -, 12/03/2009 02:14

Historique

#1 Mis à jour par esj - il y a plus de 9 ans

  • Statut changé de Nouveau à Fermé
  • Resolution mis à fixed

An extra argument has been added to calculer_balise_dynamique in r14213, not exactly as in your patch, but thanks for your suggestion.

#2 Mis à jour par esj - il y a plus de 9 ans

See also r14322 for further improvments.

Formats disponibles : Atom PDF