PDA

View Full Version : [Solved] Force Reason in Last edited


Stratis
06-06-2016, 04:29 AM
Hi!
Many users in my forum make edits to there posts, they don't write the reason for editing. Is there a way to force them to fill the field with reason. I don't know or remember if i am missing something here.

Thanks in advanced.

alcazarx
06-06-2016, 04:37 AM
Edit the code or add a plugin that checks if the reason field is set should do it me thinks.
If you ask nicely Master MarkFL will help with a small plugin me guess :rolleyes:

MarkFL
06-06-2016, 05:15 AM
Hello, Stratis...first please check to see if this product works for you:

Force Reason When Editing Posts (https://vborg.vbsupport.ru/showthread.php?t=251372)

Stratis
06-06-2016, 08:15 AM
Thanks guys for the answers...
Hi Mark, i tested the mod, it has some issues though that makes it not reliable.
1st) if i press advance edit error comes up
"An error has occurred! You must enter the reason as to why you are editing your post."

This error not supposed to show at this time...

2nd) There is a description that says "Optional" problem if they read it.

Did not check for further tests. Thank you...

MarkFL
06-07-2016, 01:19 AM
Okay Stratis, please give the attached product a try and let me know what you think. :)

There are 2 phrases:

https://vborg.vbsupport.ru/attachment.php?attachmentid=155105&stc=1&d=1465269365

The first one is what displays under the edit reason field, and the second one is the message shown to users who try to submit an edit without giving a reason.

In the product settings, you can enable/disable the product (you will have to initially enable it), and you can select usergroups who will be exempt from having to give a reason for editing posts.

Stratis
06-07-2016, 06:44 AM
Very kind of you Mark to make this possible. :)

It works with some little issue, in quick edit error message does not appear when saved button is pressed. It appears only in advance edit. (in all browsers).

* If you public this mod, it would be very nice if it has an option to put how many minimum characters (words) to accept. Some of the users i am sure they will put a dot or coma or what else :D

Thank you very much.

MarkFL
06-07-2016, 10:00 AM
Very kind of you Mark to make this possible. :)

It works with some little issue, in quick edit error message does not appear when saved button is pressed. It appears only in advance edit. (in all browsers).

* If you public this mod, it would be very nice if it has an option to put how many minimum characters (words) to accept. Some of the users i am sure they will put a dot or coma or what else :D

Thank you very much.

In the quick edit, the error message appears as a tooltip...it was the only method I could get to work.

As far as forcing users to give a valid reason, what would stop users from typing something like "edit reason here" or "xxx yyy zzz"?

Stratis
06-07-2016, 12:08 PM
* Mark do you mean this as tooltip?
155106
I see only this... and save does not take effect if field with reason is empty.

* I think if they bother to write more than 5 characters they will consider to write "update" or what else ;)

Just informing you. Thank you very much

MarkFL
06-07-2016, 02:38 PM
* Mark do you mean this as tooltip?
155106
I see only this... and save does not take effect if field with reason is empty.

* I think if they bother to write more than 5 characters they will consider to write "update" or what else ;)

Just informing you. Thank you very much

A toottip is a popup box that appears when you hover your mouse over an element (in this case the "Save" button), using the element's "title" attribute. Allowing the button to be clicked in order to produce an alert results in the post being saved no matter what, even if false is returned. :(

Stratis
06-07-2016, 02:54 PM
I thought that you see something else...
Now that you mentioned I see the tooltip, something that in all tests my eyes did not fall on, because I was watching editor with the post and the Required field. I will write in the phrase "Required" and the tooltips phrases.
Hope this will be ok, and not users keep trying to save it. :p

Thank you for your support helping me. :)

MarkFL
06-07-2016, 05:07 PM
I thought that you see something else...
Now that you mentioned I see the tooltip, something that in all tests my eyes did not fall on, because I was watching editor with the post and the Required field. I will write in the phrase "Required" and the tooltips phrases.
Hope this will be ok, and not users keep trying to save it. :p

Thank you for your support helping me. :)

I made some improvements, among these is the ability to set a minimum character count for the edit reason field. :)

Stratis
06-08-2016, 02:37 AM
At least now they wont put dots or comma, :D

I will write the "minimum characters allowed" in description to, this is a little issue
but makes what i want. Thanks a lot for another time :)

MarkFL
06-08-2016, 03:57 AM
In the next update, I will include the minimum characters in the field description as well, and I am thinking to give you the option to define a list of acceptable reasons from which the user can choose from a drop-down menu (as well as use their own). :)

MarkFL
06-08-2016, 04:51 PM
Okay Stratis,

I have attached the update containing the additional features I mentioned above. :)

Stratis
06-08-2016, 06:56 PM
Very clever Mark, Clever things by clever man :)

The only is a tiny issue with google chrome and "MarkFL - Remove Post Edit History" Modification.

* When I remove as administrator the edit history, and member goes to edit his post and than select "suggested reasons" or write in reason field "Save" button does not take effect. If user press "Cancel' and again edit, than is no problem as described above, or If browser refreshed works well.

This happens only if History is cleared, if its not there is no issue.

With IE11, Edge and Firefox no problem in all situations.
This is only info for you, so you don't say that I am not a good tester. :D

Special thanks Mark

If finally publish it and you want, have in mind the time we have in standard vb options (after how many minutes/hours will show edited post by user)

MarkFL
06-09-2016, 01:00 AM
I have attached an update, which now shows an alert on the quick edit form just like it does on the advanced edit form. :cool:

Very clever Mark, Clever things by clever man :)

The only is a tiny issue with google chrome and "MarkFL - Remove Post Edit History" Modification.

* When I remove as administrator the edit history, and member goes to edit his post and than select "suggested reasons" or write in reason field "Save" button does not take effect. If user press "Cancel' and again edit, than is no problem as described above, or If browser refreshed works well.

This happens only if History is cleared, if its not there is no issue.

With IE11, Edge and Firefox no problem in all situations.
This is only info for you, so you don't say that I am not a good tester. :D

I tested this in the updated version, and it seems to work correctly in Chrome (at least for me). :p

I would never say you are not a good tester...except perhaps to say you are an excellent tester. :D

Special thanks Mark

If finally publish it and you want, have in mind the time we have in standard vb options (after how many minutes/hours will show edited post by user)

That is an excellent suggestion to incorporate the intrinsic vBulletin permissions...so in addition to the usergroups you select to be exempt from giving an edit reason, usergroups who have "Show edited by note on edited messages?" set to "No" in the "General Permissions" section of the Usergroup Manager" will also be exempt, since requiring a reason would defeat that setting.

Also, anyone editing a post within the time limit defined in the setting "Time to Wait Before Starting to Display 'Last Edited by...'" under "Message Posting and Editing Options" will also be exempt.

So, if you don't mind Stratis, give this update a run through and let me know what you think. :)

Stratis
06-09-2016, 02:32 AM
It is better now, the only thing is "Minimum Characters" does not work.

MarkFL
06-09-2016, 02:40 AM
It is better now, the only thing is "Minimum Characters" does not work.

How so? Everything checks out for me...:)

Stratis
06-09-2016, 03:01 AM
For me it is not ok. :p

Before show you some images, the previous worked and works, tested again, uninstalled the new and installed the previous, i did this 4 times to check the new xml with clean install.

Here is the limit
155113

As you see in 4 characters i have
155111

Saved after...
155112

Here is with the previous xml, works fine.
155114

MarkFL
06-09-2016, 03:08 AM
In the image where you have "test" entered in the field, it says "Optional"...this could be because you are likely exempt due to editing before the time limit is up and/or because of your usergroup permissions...perhaps?

Stratis
06-09-2016, 05:00 AM
No it is not. Even if it is, i have Exempt Usergroups to none. That means what ever situation it must not save edited post with less than 10 characters as i have in settings. For now i use the previous xml you send and its ok. :D

Thank you :)

MarkFL
06-09-2016, 05:36 AM
No it is not. Even if it is, i have Exempt Usergroups to none. That means what ever situation it must not save edited post with less than 10 characters as i have in settings. For now i use the previous xml you send and its ok. :D

Thank you :)

Even if you have "Exempt Usergroups" set to "None," if your usergroup permissions are such that "Show edited by note on edited messages?" is set to "No" in the "General Permissions" section of the Usergroup Manager," you will always be exempt. Otherwise you will be subject to the requirements of this product.

To me, it simply makes no sense to require a user to give a reason when their permissions allow them what we call at MHB, the "Ninja edit." We allow global mods/admins the ability to edit posts without showing the post was edited (we primarily use this on the important posts of each other, such as announcements/tutorials to correct spelling/grammar errors), and if we were to require an edit reason, this would take away this ability (if "Exempt Usergroups "was set to "None").

I feel the usergroup permissions should supercede the actions of this product...however, I will add a setting in this product that will give you a choice about whether the usergroup permissions take precedence or not. :)

Stratis
06-09-2016, 06:09 AM
Sorry for not understanding well all you wrote above(my english problem)
but whatever when users put reason even if it is less than 10 character, post can be saved. Is this right? Option in modification "Minimum Characters" does not take effect in all situation we have in vbsettings?

Any way don't bother for anything else, i will find the way as it is.

Thank you Mark

MarkFL
06-09-2016, 07:41 AM
Everything works exactly as it should in Firefox...however Chrome fails to execute the mouse events properly (known but as of yet unaddressed bugs), and I simply don't have any more time at the moment to squander on browser failure workarounds.

Stratis
06-09-2016, 07:44 AM
Yes, yes its not a big deal. :)

MarkFL
06-09-2016, 02:00 PM
Since Chrome is broken with respect to the needed mouse events, the best workaround here is to simply disable the quick edit if Chrome is being used, which I have done in this latest update.;)

MarkFL
06-10-2016, 04:16 AM
I devised a workaround to overcome Chrome's shortcomings, and published the product here:

Require Edit Reason (https://vborg.vbsupport.ru/showthread.php?t=322820)