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

Issue 1564 mariadb to mysql #1567

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions htdocs/pages/administration/site_articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function checkNoSpace($value): bool
$formulaire->addRule('titre' , 'Titre manquant' , 'required');
$formulaire->addRule('contenu' , 'Contenu manquant' , 'required');
$formulaire->addRule('raccourci' , 'Raccourci manquant' , 'required');
$formulaire->addRule('id_site_rubrique' , 'Rubrique manquante' , 'required');

$formulaire->registerRule('checkNoSpace', 'callback', 'checkNoSpace');
$formulaire->addRule('raccourci', 'Ne doit pas contenir d\'espace', 'checkNoSpace', true);
Expand Down
12 changes: 6 additions & 6 deletions sources/Afup/Corporate/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,16 @@ function modifier()
$requete = 'UPDATE afup_site_article
SET
id_site_rubrique = ' . $this->bdd->echapper($this->id_site_rubrique) . ',
id_personne_physique = ' . $this->bdd->echapper($this->id_personne_physique) . ',
id_personne_physique = ' . $this->bdd->echapper($this->id_personne_physique ?: null) . ',
titre = ' . $this->bdd->echapper($this->titre) . ',
raccourci = ' . $this->bdd->echapper($this->raccourci) . ',
chapeau = ' . $this->bdd->echapper($this->chapeau) . ',
contenu = ' . $this->bdd->echapper($this->contenu) . ',
type_contenu = ' . $this->bdd->echapper($this->type_contenu) . ',
position = ' . $this->bdd->echapper($this->position) . ',
date = ' . $this->bdd->echapper($this->date) . ',
theme = ' . $this->bdd->echapper($this->theme) . ',
id_forum = ' . $this->bdd->echapper($this->id_forum) . ',
theme = ' . $this->bdd->echapper($this->theme ?: null) . ',
id_forum = ' . $this->bdd->echapper($this->id_forum ?: null) . ',
etat = ' . $this->bdd->echapper($this->etat) . '
WHERE
id = ' . $this->bdd->echapper($this->id);
Expand All @@ -252,16 +252,16 @@ function inserer()
$requete = 'INSERT INTO afup_site_article
SET
id_site_rubrique = ' . $this->bdd->echapper($this->id_site_rubrique) . ',
id_personne_physique = ' . $this->bdd->echapper($this->id_personne_physique) . ',
id_personne_physique = ' . $this->bdd->echapper($this->id_personne_physique ?: null) . ',
titre = ' . $this->bdd->echapper($this->titre) . ',
raccourci = ' . $this->bdd->echapper($this->raccourci) . ',
chapeau = ' . $this->bdd->echapper($this->chapeau) . ',
contenu = ' . $this->bdd->echapper($this->contenu) . ',
type_contenu = ' . $this->bdd->echapper($this->type_contenu) . ',
position = ' . $this->bdd->echapper($this->position) . ',
date = ' . $this->bdd->echapper($this->date) . ',
theme = ' . $this->bdd->echapper($this->theme) . ',
id_forum = ' . $this->bdd->echapper($this->id_forum) . ',
theme = ' . $this->bdd->echapper($this->theme ?: null) . ',
id_forum = ' . $this->bdd->echapper($this->id_forum ?: null) . ',
etat = ' . $this->bdd->echapper($this->etat);
if ($this->id > 0) {
$requete .= ', id = ' . $this->bdd->echapper($this->id);
Expand Down
16 changes: 16 additions & 0 deletions tests/behat/features/Admin/Site/AdminSiteArticles.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
Feature: Administration - Partie Site

Scenario: Ajout d'un article avec le minimum d'info
Given I am logged in as admin and on the Administration
And I follow "Articles"
Then I should see "Liste des articles"
And I should see "Actualités"
When I follow "Ajouter"
Then I should see "Ajouter un article"
And I fill in "titre" with "Le titre mini"
And I fill in "contenu" with "Le contenu mini"
And I fill in "raccourci" with "url-article-mini"
And I select "Actualités" from "id_site_rubrique"
And I select "9" from "position"
And I press "Ajouter"
When I should see "Liste des articles"
Then the ".content table" element should contain "Le titre mini"

@reloadDbWithTestData
Scenario: Ajout/modification/suppression d'un article
Given I am logged in as admin and on the Administration
Expand Down