Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Un warning après création d'une campagne #34

Open
jpyrat opened this issue Aug 6, 2020 · 3 comments
Open

Un warning après création d'une campagne #34

jpyrat opened this issue Aug 6, 2020 · 3 comments

Comments

@jpyrat
Copy link

jpyrat commented Aug 6, 2020

Bonjour,

Juste après avoir créé une campagne, il y a cette erreur juste en dessous de "Souscription déléguée" :
Warning: count(): Parameter must be an array or an object that implements Countable in spip_souscription\formulaires\souscription.php on line 374

Testé avec SPIP 3.3.0-dev SVN [24619]

@jpyrat
Copy link
Author

jpyrat commented Aug 6, 2020

Et c'est pareil dans une page d'article après avoir inséré le raccourcis pour la souscription.

@jpyrat
Copy link
Author

jpyrat commented Aug 6, 2020

La ligne en question contient :
if (!count($campagne['type_objectif']))

Mais un var_dump de $campagne donne :

array (size=4)
  'type_objectif' => string 'don' (length=3)
  'objectif_initial' => string '0' (length=1)
  'objectif' => string '0' (length=1)
  'objectif_limiter' => string 'off' (length=3)

@jpyrat
Copy link
Author

jpyrat commented Aug 6, 2020

Rajouter juste avant le test cette ligne résout le problème :
$campagne['type_objectif'] = explode(',', $campagne['type_objectif']);

Mais est-ce la bonne solution ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant