Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update class.plx.motor.php #554

Merged
merged 3 commits into from Mar 11, 2022
Merged

Update class.plx.motor.php #554

merged 3 commits into from Mar 11, 2022

Conversation

gcyrillus
Copy link
Contributor

modif ligne 685 : recherche sur la premiere(et unique) clé au lieu de faire une recherche sur une clé nommée

Il peut parfois arrivé que la clé testée n'existe pas car sa valeur peut differer de '0' .
En utilisant key($array) sur un tableau d'une seule valeur, on peut tester la valeur de son unique clé sans en connaitre le nom.

modif ligne 685 : recherche sur la premiere(et unique) clé au lieu de faire une recherche sur une clé nommée
modification de la modif illogique initial :
@gcyrillus
Copy link
Contributor Author

gcyrillus commented Feb 25, 2022

Cette premiere proposition n'avait en fait pas de sens, voir le sujet : https://forum.pluxml.org/discussion/7143/plxmotor-ligne-685-un-bogue-possible
Dans le même temps j'en etait arrivé à modifié comme ceci : if(count($artCats) == 1 and array_values($artCats)[0] == 'draft') {

La bonne solution a adopter serait finalement : if(count($artCats) == 1 and in_array('draft', $artCats)) {
cdt

et finalement sur le bon conseil de @bazooka07
haruka-7 added a commit that referenced this pull request Mar 11, 2022
@haruka-7 haruka-7 merged commit 99940c8 into pluxml:master Mar 11, 2022
@haruka-7 haruka-7 added the bug label Mar 11, 2022
@haruka-7 haruka-7 added this to the PluXml 5.8.8 milestone Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants