Dotclear

Ticket #590 (closed enhancement: fixed)

Opened 17 years ago

Last modified 15 years ago

Behavior adminCommentsActions

Reported by: franck Owned by: bruno
Priority: normal Milestone: 2.2
Component: module:core Version: 2.1
Severity: normal Keywords:
Cc:

Description

Il serait utile d'avoir, comme pour les billets, un behavior appelé sur via le menu actions sur la liste des commentaires sélectionnés.

Change History

comment:1 Changed 15 years ago by bruno

  • Owner changed from olivier to bruno

comment:2 Changed 15 years ago by bruno

(In [2973]) Added "adminCommentsActions" and "adminCommentsActionsCombo" behaviors, see #590

comment:3 Changed 15 years ago by xave

  • Status changed from new to closed
  • Resolution set to fixed

(In [2984]) Merging changes from the Bazar branch. Closes #503, #555, #590, #696, #696, #779, #781, #791, #863, #876, #908, #922, #929, #939, #941, #942. Thanks to DSLS & Tomtom33

comment:4 Changed 15 years ago by franck

  • Status changed from closed to reopened
  • Resolution fixed deleted

Visiblement la modification apportée provoque le problème suivant lors de l'utilisation de ces behaviors. J'obtiens, après le passage par le formulaire secondaire le message suivant :

Notice: Undefined variable: action in /…/admin/comments_actions.php  on line 104

(Je peux mettre à disposition une version de mon plugin Typo qui utilise ces behaviors)

comment:5 Changed 15 years ago by bruno

(In [3169]) Prevent warning when $action is empty in admin/comments_actions.php. Addresses #590

comment:6 Changed 15 years ago by franck

Visiblement la modif corrige l'erreur mais du coup dévoile un dysfonctionnement :

  1. Je sélectionne 1 ou plusieurs commentaires, je sélectionne l'option ajoutée par mon plugin (Typo 1.5) et je valide
  1. Je bascule comme prévu sur le formulaire secondaire géré par le plugin et je valide
  1. Au lieu de passer par le behavior qui effectue l'action demandée je reviens sur une page vierge (comments_actions) ?!?

Y'a un blème que je n'arrive pas à cerner.

comment:7 Changed 15 years ago by bruno

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [3170]) Merged [3169] on 2.2/current, closes #590

comment:8 Changed 15 years ago by bruno

franck: à la fin de ton traitement dans le behavior adminPostsActions, il faut faire un http::redirect($redir);

Voir par exemple le plugins/tags/_admin.php pour un comportement-type pour les billets.

comment:9 Changed 15 years ago by franck

  • Status changed from closed to reopened
  • Resolution fixed deleted

Tss Tss, relisez mon commentaire précédent siouplé.

Le [3169] ne règle pas tout.

Je complète, il s'agit de adminCommentsActions en l'occurence et le code que j'ai dans mon plugin pour traiter ce behavior est le suivant :

if ($action == 'typo' && !empty($_POST['set_typo'])
&& $core->auth->check('contentadmin',$core->blog->id))
{
	try
	{
		if ((boolean)$_POST['set_typo']) {
			while ($co->fetch())
			{
				if ($co->comment_content) {
					# Apply typo features to comment
					$cur = $core->con->openCursor($core->prefix.'post');

					if ($co->comment_content)
						$cur->comment_content = SmartyPants($co->comment_content);

					$cur->update('WHERE comment_id = '.(integer) $co->comment_id);
				}
			}
		}
				
		http::redirect($redir);
	}
	catch (Exception $e)
	{
		$core->error->add($e->getMessage());
	}
}

Soit quasiment le même que celui que j'ai pour les actions sur billets et qui lui fonctionne parfaitement. Les seules différences concernent la portée (champs) du traitement.

comment:10 Changed 15 years ago by bruno

(In [3171]) Added missing hidden_fields in admin/comments_actions.php, see #590.

comment:11 Changed 15 years ago by bruno

(In [3172]) Removed extra hidden field, see #590

comment:12 Changed 15 years ago by franck

Toujours pas au bout, cette fois j'ai droit à un :

Notice: Undefined index: type in /…/admin/comments_actions.php on line 32

comment:13 Changed 15 years ago by bruno

(In [3173]) I really need to sleep... see #590 (rolled back [3172])

comment:14 Changed 15 years ago by franck

  • Status changed from reopened to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.

Sites map