Post Friction

Post Friction [Paid] 2.12.0

No permission to buy ($30.00)
@Joe Link can you dump the xf_thread.friction column for that thread?

You might need to edit and then save the post friction options for the thread. That feature got renamed, so I may need to work on the UI so it handles those older threads

Also noticed I am aware this thread is locked, I still want to post a reply. is showing below the warning, even though the thread is not locked.
This is because you've edited the sv_pf_accept_friction_post phrase.
 
@Joe Link can you dump the xf_thread.friction column for that thread?

You might need to edit and then save the post friction options for the thread. That feature got renamed, so I may need to work on the UI so it handles those older threads

With the exception of five threads, all threads have NULL in the friction column. This doesn't change when I change any of the settings on the front-end, except when I set Moderate replies to thread, in which case the column value changes to {"modPosts":true}.

This is because you've edited the sv_pf_accept_friction_post phrase.

Well I feel silly now 🤣
 
With the exception of five threads, all threads have NULL in the friction column. This doesn't change when I change any of the settings on the front-end, except when I set Moderate replies to thread, in which case the column value changes to {"modPosts":true}.
Please check the template sv_pf_thread_friction isn't out of date and/or doesn't contain significant modifications.
 
Please check the template sv_pf_thread_friction isn't out of date and/or doesn't contain significant modifications.

Despite that last screenshot, I use the default style for all testing (and I also make sure all template modifications are being applied correctly).

I'm seeing the same thing as before, though I did just notice that if I change the actual value per-thread and not just the options, the friction column in xf_thread does update (in this case changing to {"cutoff":1}). All the other threads still have a value of NULL, and I'm still seeing the old thread notice in the quick reply.
 
  • Like
Reactions: Xon
Xon updated Post Friction with a new update entry:

2.7.3 - Bugfix update

  • Fix "Old thread cut-off" option with value of 0 didn't disable the old-thread warning
  • Fix "Old thread cut-off" option could have a per-thread value applied when the per-thread configuration page suggested it shouldn't
  • Fix type-juggling when forum-wide post-friction options are used
  • Migrate threads which used old friction key values to the new versions

Read the rest of this update entry...
 
Heya, thank you for this nice addon. I have question, where I can change phrase "It is very likely that it does not need any further discussion and thus bumping it serves no purpose."? I find it as phrase "sv_pf_messages.cutoff" but when I change it, nothing happened. :(
 
if developer mode is enabled, make sure you are editing the default language (ie language id 1) and not the master language (ie language id 0).
 
Xon updated Post Friction with a new update entry:

2.8.1 - Feature update

  • Require XenForo 2.2+
  • Recommend php 7.2+
  • Fixed missing post friction log reasons for multi-posting and mostly-quotes
  • Add "warn on media/url/image" post friction option, with admin-defined customizable per-forum phrase overriding
  • Show old/locked thread post friction warnings to users with the 'Bypass post friction restrictions' permission

Read the rest of this update entry...
 
Hey!

When turned on, the "Old thread cut-off" setting causes the warning box to appear before errors are checked for, causing the message to look a bit odd:
1685096714247.webp
Note the "Your message may be considered spam for the follow reasons" which isn't actually followed by any reasons.

If the user attempts to post the reply anyway without checking the box, the warning box will update to display the error message as expected:
1685096812945.webp

Tested locally on XenForo 2.2.13, Post Friction 2.9.0, and Standard Library 1.18.4.
 
Thanks for the quick fix!

After upgrading the add-on and configuring it, we're now seeing this error pop up frequently:
Code:
ErrorException: [E_WARNING] Undefined array key "warnOnMultiPostForThreadStarter" src/addons/SV/PostFriction/XF/Entity/Post.php:442
Generated by: REDACTED May 30, 2023 at 6:02 PM
Stack trace
#0 src/addons/SV/PostFriction/XF/Entity/Post.php(442): XF::handlePhpError(2, '[E_WARNING] Und...', REDACTED, 442)
#1 src/addons/SV/PostFriction/XF/Entity/Post.php(261): SV\PostFriction\XF\Entity\Post->checkFrictionActions(true, Array, Array)
#2 src/addons/SV/PostFriction/XF/Entity/Post.php(526): SV\PostFriction\XF\Entity\Post->checkFriction(true)
#3 src/addons/SV/WarningImprovements/Entity/SupportsEmbedMetadataTrait.php(54): SV\PostFriction\XF\Entity\Post->_preSave()
#4 src/XF/Mvc/Entity/Entity.php(1366): SV\WarningImprovements\XF\Entity\Post->_preSave()
#5 src/XF/Mvc/Entity/Entity.php(1386): XF\Mvc\Entity\Entity->preSave()
#6 src/XF/Service/Thread/Creator.php(448): XF\Mvc\Entity\Entity->preSave()
#7 src/addons/SV/UserEssentials/Service/Content/SimplifiedPreviewTrait.php(64): XF\Service\Thread\Creator->_validate()
#8 src/addons/SV/PostFriction/XF/Service/Thread/Creator.php(61): SV\UserEssentials\XF\Service\Thread\Creator->_validate()
#9 src/XF/Service/ValidateAndSavableTrait.php(19): SV\PostFriction\XF\Service\Thread\Creator->_validate()
#10 src/addons/SV/PostFriction/XF/Service/Thread/Creator.php(66): XF\Service\Thread\Creator->validate(NULL)
#11 src/XF/Pub/Controller/Forum.php(901): SV\PostFriction\XF\Service\Thread\Creator->validate(NULL)
#12 src/addons/SV/PostFriction/XF/Pub/Controller/Forum.php(21): XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(352): SV\PostFriction\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#14 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', Object(XF\Mvc\RouteMatch), Object(SV\StandardLib\XF\Pub\Controller\Forum), NULL)
#15 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\StandardLib\XF\Pub\Controller\Forum), NULL)
#16 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#17 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#18 src/XF.php(524): XF\App->run()
#19 index.php(20): XF::runApp('XF\\Pub\\App')
#20 {main}

We're currently running on XenForo 2.2.13, Standard Library 1.18.4, User Essentials 4.2.15, Post Friction 2.9.1, Warning Improvements 2.9.0, and some other add-ons.
 
@Xon

Prior to 2.9.0, I added an if statement to the sv_pf_thread_friction template to restrict moderators to enabling/disabling reactions only (the only reason we use this addon).

Code:
<xf:if is="$thread.canEditPostFriction() && $xf.visitor.is_admin">
        <xf:form action="{{ link('threads/friction', $thread) }}" class="block-body" ajax="true">
              <form action macros here>
           <xf:submitrow icon="save" sticky="true" />
       </xf:form>
<xf:elseif is="$thread.canEditPostFriction() && $xf.visitor.is_moderator"/>
        <xf:form action="{{ link('threads/friction', $thread) }}" class="block-body" ajax="true">
            <xf:set var="$defaults" value="{{ $forum.getPostFrictionOptions() }}" />

            <xf:checkboxrow>
                <xf:option name="modPosts" value="1" selected="{$thread.friction.modPosts}"
                    label="{{ phrase('sv_pf_moderate_posts') }}"
                    hint="{{ phrase('link_friction_moderate_posts_explain') }}">
                </xf:option>
            </xf:checkboxrow>
                 
            <xf:submitrow icon="save" sticky="true" />
        </xf:form>
</xf:if>

This still works to enable/disable reactions in 2.9.0+, but when saved, all the other PF options are set to "Use thread option" (with the default option) rather than "Use global option" (maybe because <xf:set var="$defaults" value="{{ $forum.getPostFrictionOptions() }}" /> no longer works?).

Is there something I can add to the xf:elseif section above to keep the other PF options set to "Use global option"?
 

Attachments

  • 1685650412930.webp
    1685650412930.webp
    9 KB · Views: 2
@Xon can this be used to restricted specific reaction in specific thread?

for example if you have many reactions available for users to use, can one reaction being blacklisted in specific thread?
 
This still works to enable/disable reactions in 2.9.0+, but when saved, all the other PF options are set to "Use thread option" (with the default option) rather than "Use global option" (maybe because <xf:set var="$defaults" value="{{ $forum.getPostFrictionOptions() }}" /> no longer works?).

Is there something I can add to the xf:elseif section above to keep the other PF options set to "Use global option"?
Ugh, the code isn't quite smart enough to have a list of options which where rendered so it isn't going to sanely work.

I'll need to have a look to see what I can easily do

@Xon can this be used to restricted specific reaction in specific thread?

for example if you have many reactions available for users to use, can one reaction being blacklisted in specific thread?
Yes, this is a supported configuration to disable a reaction for a specific thread
 
Top Bottom