I created a patch to allow use of descriptions in the confirmation message when you flag or unflag something.

I do not know if it was a decision of design not to include the description in the original code, but for me, it was useful in some cases where I need to explain a little more the meaning of flag or unflag something.

The patch works for the last 6.x-dev version

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

I think we're just getting a little wary about the number of textfields we're asking users to fill out for creating a flag. We need some kind of better UI for arranging all these options, especially when ones like confirmation and confirmation_message don't even have an effect unless you're using the confirmation option.

mooffie’s picture

Component: Code » Flag core
Status: Needs review » Closed (won't fix)

It can certainly be useful to be able to type a description ("Guidelines", in Drupal parlance).

And... it could also be useful to be able to type the labels for the buttons.

And... it would have been much better if our "Confirmation Form" was a full-blown form which modules (like Flag Note) could extend.

And... if it was "ajaxable".

In other words, our "Confirmation Form" is puny. I think we should leave it as is, because adding the "guidelines" features alone won't help much.

One ultimate solution is the "Form" link-type (see screenshot), written together with a patch for D7's Flag. There isn't much in it, so porting it to D6 is feasible.

So I'm marking this (quite old) issue "wontfix" / "duplicate".

Gabriel R.’s picture

The Flag link description could very well be used as the description on the confirmation page.
I was about to do a patch myself, but I will work from this one.

Gabriel R.’s picture

Status: Closed (won't fix) » Needs review
FileSize
631 bytes

Short and sweet.

quicksketch’s picture

Status: Needs review » Needs work

I don't know about this dual-usage. If you use the long description, most likely it won't make sense in one location or another.

For example if you used "Are you sure you want to unflag this node?" as the long description, that wouldn't make sense as hover-text for the link (which is what the long description is usually used for). Likewise if you had the long text "Click here to unflag this node", it wouldn't make any sense on the confirmation page.

quicksketch’s picture

Let's merge in the request from #1118680: Flag question editable? here too. It's a similar issue but is requesting to be able to change the "Question" (that is the page title) on the confirmation form.

quicksketch’s picture

Title: Descriptions in confirmation messages » Make confirmation form "Question" and "Description" editable
jaydub’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs work » Needs review
FileSize
513 bytes

Right now the options for a flag when the link type is Confirmation form allows for the setting of a 'flag confirmation message' and 'unflag confirmation message'. The description text is:

"Message displayed if the user has clicked the "flag this" link and confirmation is required. Usually presented in the form of a question such as, "Are you sure you want to flag this content?""

When I read that description it's my expectation that the message would be displayed on the page with the confirmation form above the confirm button / cancel link. The reality is that the value of this confirmation message is passed to the drupal core function confirm_form() as the $question variable.

In confirm_form() itself the only use of the $question parameter is to set the page title (http://api.drupal.org/api/drupal/modules--system--system.module/function...).

It seems to me that the actual desired use of the 'flag confirmation message' string is to have that message show above the confirm_form() confirm button / cancel link which is set using the confirm_form() function via the $description variable.

I think that simply passing the flag confirmation message to confirm_form() for both the $question and $description parameters effectively solves the problem here since the current value of the message through the flag settings _only_ sets the page title.

This is the case in both 6.1 and 6.2 so I switched the version to 6.2 and added what is a much simpler patch (against 6.2).

If I'm way off here feel free to correct me.

jaydub’s picture

And drupal 7 version of the patch attached

quicksketch’s picture

FileSize
21.4 KB

I don't think this approach is correct, or at least it's not common in Drupal to do this. See the attached screenshot of the Node Delete confirmation as an example. The $description variable usually is just additional text rather than the $question, which (as you said) is displayed as the page title.

joachim’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Needs review » Needs work

Making as needs work in light of the above comment.

But there's also a comment further up that this should be postponed / wontfixed due to #871064: Making flaggings fieldable.

joachim’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

Upping the version.

> One ultimate solution is the "Form" link-type (see screenshot), written together with a patch for D7's Flag. There isn't much in it, so porting it to D6 is feasible.

This needs consideration. If Flagging Form module offers more customization, then we should leave the basic form basic.

ñull’s picture

A question, just to get this clear. The extra custom text would need to be added to the form with something like markup?