My 6.x fork has a feature where if duplicates have previously been displayed, and there are currently no duplicates (and a non-blank title), then a text such as "Success! No duplicates found." is shown.

I propose to add a configuration setting similar to the "Searching ..." text for the success text. This would be passed in the settings to jQuery. The location of the success text would be in the theme function.

Comments

danchadwick’s picture

Status: Active » Needs review
StatusFileSize
new2.54 KB

Please apply after other outstanding issues. Please apply outstanding patches oldest-first to help avoid re-rolls.

bforchhammer’s picture

Status: Needs review » Needs work
+++ b/uniqueness.admin.inc
@@ -96,6 +96,12 @@ function uniqueness_settings($form, &$form_state) {
+    '#description' => t('The text to display while the Uniqueness search no longer finds possible duplicate content.'),

Maybe better: "The text to display if the uniqueness search does not find any related content."

+++ b/uniqueness.module
@@ -230,6 +230,7 @@ function _uniqueness_get_js_settings($type, $nid, $preview) {
+    'uniqueString' => filter_xss_admin(variable_get('uniqueness_unique_string', t('Success! No related content found.'))),

Can we call it e.g. "noResultsString" instead of "uniqueString"? I think that would describe it more appropriately considering that the settings page talks about providing a uniqueness search.

danchadwick’s picture

Status: Needs work » Needs review
StatusFileSize
new2.67 KB

Sure.

Title: Unique message --> No related content message
'#description' -> The text to display if the uniqueness search no longer finds any related content.
The reason I chose this wording is because the message is not displayed if a search hasn't returned results previously. In other words, it isn't really a "success" if you edit a node that already has a unique title.

And I changed the two variables to refer to "no result" rather than "unique. I also uncapitalized "Uniqueness" in two places.

I will address the node add form incorrect wording and add the note about blocks not being shown for admins later as these lines are physically close to this one and I fear they won't apply.

bforchhammer’s picture

One more question: currently the "empty text" replaces all the content within the results fieldset/block including the description ("Help us increase the signal/noise ratio... "). I was actually expecting the description to remain visible, and the "empty text" only appear instead of the results lists.

Do you have a strong opinion for doing it this way? Otherwise could we leave the widget description visible?

danchadwick’s picture

I did think about this some and it does work as I intended. Here's my logic:

- User starts typing (or starts editing an existing node with duplicate content).
- User receives admonishment to "increase the signal-to-noise ratio". Now in actual use, this is a very poor prompt and should probably be re-written, but that would be another issue. My site uses something like:

<span class="somthing-that-makes-this-bold-and-red">Duplicate blah-blah</span> found. Blah-blah with similar names:

- User reads admonishment and decides to enter different content, with a different, unique name.
- The admonishment disappears and is replaced with the noResult / success message. Mine is something like:

<span class="something-that-makes-this-bold-and-green">Success!</span> No duplicate blah-blah found.

So it would be much, much better I think to remove the admonishment when it does not apply.

If you agree, great. If not then I fear I'd like an option of some sort. Which I hope isn't necessary.

bforchhammer’s picture

Hm, so I guess this depends a lot on what you set as the description... Your user story makes sense, but imagine if a user first enters a unique title and then expands "Related content" (out of curiosity); in this case they would just see "Success! No related content found." -- not very helpful if you don't know why that UI widget is there.

Maybe we can add a dynamic css class to the fieldset for "no results"; then you could simply hide the description when there isn't a result. Adding a bunch of css classes for advanced styling would probably be a good idea either way.

danchadwick’s picture

Actually in your scenario, it would still display the original prompt. The success message is display only after it wasn't unique (in which case it was expanded) and then it was. So your user would see:

Collapsed
They type something unique. Fieldset is still collapsed, but the normal description is in there.
They type something non-unique. Fieldset expands, still showing normal description, with results too.
They make it unique.
Fieldset stays expanded, description and null results replaced by success message.

Works, no?

I already coded your suggestion (which is trivial), but then I realized that it didn't apply. Do you still disagree? I can make a patch, but I don't think its needed or better, unless I'm missing something.

bforchhammer’s picture

Status: Needs review » Fixed

but then I realized that it didn't apply.

Have you tried git merge? Usually works quite well for me :)

Committed and pushed #3.

We should probably add more css classes as well anyway, but I'll leave that for a follow-up.

danchadwick’s picture

I'm pretty sure I can access anything that I'd want to style, no? I could imagine wrapping the whole thing in a div, but you can access whatever you want via either block or fieldset selectors, no? And they can put tags in their messages if they want (now that filter_xss_admin is used).

Oh, PS. I meant "apply" as in is applicable or relevant, not as in source code control. Poorly written comment. Sorry.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.