Closed (won't fix)
Project:
Best reply
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2012 at 07:04 UTC
Updated:
15 May 2014 at 15:33 UTC
Jump to comment: Most recent
Comments
Comment #1
taslett commentedHi kervi,
I don't know enough about rules and am not prepared to implement the rules api at the moment.
If you write the api integration I will add it to the module.
Comment #2
taslett commentedComment #2.0
taslett commented1
Comment #3
gladiatorhl2 commentedIt is a very good module and it deserves more attention than it actually has. I wanted to implement rules integration but it is quite hard to fully understand the code for me, because I am not a PHP programmer and I can program only something simple.
It would be great to get at least a rule integration ''best reply selected'' and ''best reply unselected'' like for Best Answer module (Answers) but it has 2 content types (Question and Answer) and it is its big weakness in my opinion, as certain rules cannot be put for two content types at the same time!
Comment #4
taslett commentedOk I have added basic Rules integration, it should show up as a dev release with todays date shortly.
Test it out and let me know how it goes.
Comment #5
gladiatorhl2 commentedI am so glad that it could be released! I am certain that other people will be happy, too. I tested it out and it goes quite well at the moment. If I find some bugs, I will post comments. Is it possible to donate, if you do not mind?
Comment #6
taslett commentedHi gladiatorhl2,
Glad you find it useful.
You can donate via paypal to: tony [AT] appcreator.com
Comment #7
gladiatorhl2 commentedHello,
I have noticed a problem. If somebody clicks ''Best reply'' several times, rules are also executed several times. For example, one rule was done that after clicking ''Best reply'', a private message is sent. If ''Best reply'' is clicked several times, several messages are sent.
Comment #8
taslett commentedHi gladiatorhl2,
Is there a way to restrict that via the rule?
Not really sure how to do this in code but can look into it.
Do you only want it sent the first time Best Reply is clicked?
Comment #9
gladiatorhl2 commentedHi taslett,
I was searching this functionality in rules and it seems that there is no any rule which could restrict a repeated execution of rules (at least that they will continue to function after that action).
I will try to describe a problem in detail. ''Best Reply'' button is changed into ''Clear Best Reply'' after clicking it and it is good. Of course, it takes time to see this change. During this action if somebody rapidly clicks this button several times, rules are also executed several times. I suppose that it means that there must be a restriction which prevents the second and following clicks while rules are executed.
I confirm that I would like a message to be sent only the first time. I guess that the problem could be similar to this one https://drupal.org/node/69048
Comment #10
gladiatorhl2 commentedHello taslett,
I was searching some information about it. I don't know how to fix it. I understand that after clicking ''Best Reply'', a page must be reloaded manually to avoid a repeated execution of rules. Is there a way to reload it automatically?
Comment #11
gladiatorhl2 commentedMaybe it is impossible to refresh a page that an author would view it immediately through his browser. At this moment I might understand that the second click of ''Best Reply'' must be prevented somehow and only for this node, not for others.
Comment #12
taslett commentedHi gladiatorhl2,
I have been pretty busy and haven't had much of a chance to look into this.
Currently it uses ajax to apply the changes such as best reply.
If JavaScript is disabled it will reload the page. So if you want to test out the issue and see if reloading helps then disable JavaScript in your browser.
If that works I can add a new setting to reload the page or disable JavaScript.
Comment #13
gladiatorhl2 commentedHi taslett,
After trying this option, the problem persists to be there. If ''Best Reply'' is clicked three times, three messages are still received. In addition, there is no moved ''Best Reply'' to top. In order to see it, JavaScript must be enabled. Maybe all that happens because there is also an error (I removed a part of the path to the file):
Notice: Trying to get property of non-object in function _bestreply_remove_upoints() (string 487 in file ...\sites\all\modules\bestreply\bestreply.module).
Could you propose any directions? Thank you in advance.
Comment #14
taslett commentedHi gladiatorhl2,
I'll look at where the rule is invoked and see if I can restrict it to once.
Comment #15
taslett commentedHi gladiatorhl2,
The latest dev branch should fix the issue.
A user shouldn't be able to keep clicking to trigger the rule now.
Test it out and let me know how it goes.
Comment #16
gladiatorhl2 commentedHi taslett,
I have just read your response and tested the module. If JavaScript is on, it works fine, I think. Thank you very much.
I have noticed only two minor errors.
1) If a rule ''Show a message on the site'' is triggered by clicking ''Best Reply'', it does not appear and Best Reply comment doesn't move to top automatically. I suppose that they are related to the same minor problem. The entire page must be reloaded entirely. I wanted to show a message on the site ''Refresh the page in your browser'' but it doesn't appear, so a user can't see the moved Best Reply to top and he does not know exactly what he is supposed to do (especially a new visitor).
If we see the refreshed page with moved Best Reply comment to top and this time if ''Clear Best Reply'' is clicked, Best Reply comment disappears automatically. It works fine. If it worked like that after clicking ''Best Reply'', it would be perfect.
2) After clicking ''Best Reply'', a line ''Clear Best Reply'' appears. I think that ''Best Reply'' rests there and only ''Clear'' is forced to appear before ''Best Reply'' to complete the whole phrase ''Clear Best Reply'', so for some languages it is almost impossible to choose proper words so that they would be coherent to each other. The page must be refreshed to see the whole translated phrase ''Clear Best Reply'', not ''Clear'' + ''Best Reply''.
I am sorry that I have written such a long text. English is not my mother tongue :)
Thank you in advance for any suggestions.
Comment #17
gladiatorhl2 commentedHi taslett,
I think that I have fixed this issue :) I was searching quite a lot through the Internet and it was eventually quite easy to refresh the whole page. I do not know exactly, if it is needed to be included in the developed version of the module, because it is not so critical.
Thank you for this module. Probably I will contribute again in some time when I will launch my website :). It is a very long way for me.
Comment #18
Powergird commentedI have meet the same erro "Notice: Trying to get property of non-object in function _bestreply_remove_upoints() (string 487 in file ...\sites\all\modules\bestreply\bestreply.module)."
by using latest dev branch。
any help ,thanks much.
Comment #19
gladiatorhl2 commentedI suppose that you can comment these lines. I did it and the module functions well so far.