Coder Social home page Coder Social logo

Comments (20)

BahodurSaidov avatar BahodurSaidov commented on July 23, 2024 1

i had same issue with automatic user activation by sending mail...
Something wrong with UserPlus plugin, it seems that some notification rule is created by the plugin without any rule_conditions...
Temporary solution would be to disable UserPlus plugin and disable Rain.notify plugin, but enable back notify plugin , all from backend...
This worked for me... wasted couple of hours searching though

from notify-plugin.

LukeTowers avatar LukeTowers commented on July 23, 2024 1

No idea @w20k, I haven't actually used this plugin

from notify-plugin.

w20k avatar w20k commented on July 23, 2024 1

@LukeTowers, I was thinking to add additional validation based on the number of rules or if the repeater is empty.
I agree! The message is definitely confusing. I've added this task to my ToDo List.

from notify-plugin.

saulo-silva avatar saulo-silva commented on July 23, 2024

same problem

from notify-plugin.

LukeTowers avatar LukeTowers commented on July 23, 2024

@saulo-silva are you using the UserPlus plugin as well?

from notify-plugin.

vdomah avatar vdomah commented on July 23, 2024

Also has got this. Seems it's caused by uncompleted deferred binding of rule_conditions. First I was getting only rule_conditions records without rule_host_id. I'm not sure, but seems I've fixed this by resaving the notification rule in backend
http://prntscr.com/lqie4u

from notify-plugin.

LukeTowers avatar LukeTowers commented on July 23, 2024

If someone can narrow down a cause and submit a PR to fix it that would be helpful.

from notify-plugin.

w20k avatar w20k commented on July 23, 2024

@BahodurSaidov, could you provide a simple example of how to reproduce it?

from notify-plugin.

BahodurSaidov avatar BahodurSaidov commented on July 23, 2024

@w20k, i think you should be able to reproduce with build 446 install User & UserPlus plugin. Then enable registration, from User settings select activated by user (send link to mail).
Also, during this issue, i was deleting test user several times from backend and re-registering so to get test activation mail...
It should be mentioned that when the problem exists, the mail with activation link is NOT sent after registration form, and an exception is thrown at frontend with flash messaging saying something with "notification rule...".
This much I remember... Hope it helps...
Please let know if you could reproduce the issue by following these steps...

from notify-plugin.

w20k avatar w20k commented on July 23, 2024

Side note: by default, if you use the built-in notification rule - email template is wrong.
@BahodurSaidov, mail template naming should fix your issue.

from notify-plugin.

web-studio-51 avatar web-studio-51 commented on July 23, 2024

Hi! Im from Russia, but you can translate my text:

Проблема решается очень просто, заходим в файл plugins/rainlab/notify/models/NotificationRule.php

и комментируем строки 71-77

// if (!$rootCondition) {
// throw new ApplicationException('Notification rule is missing a root condition!');
// }

    // if (!$rootCondition->getConditionObject()->isTrue($params)) {
    //     return false;
    // }

Отключив эту проверку, ошибка высвечиваться не будет, но плагин работает корректно

from notify-plugin.

BahodurSaidov avatar BahodurSaidov commented on July 23, 2024

@web-studio-51, интерестно зачем вообще добавили ApplicationException туда ?!

from notify-plugin.

w20k avatar w20k commented on July 23, 2024

Wait, @LukeTowers, could you clarify one thing. Should notify-plugin rules work without defining a single condition?
Finally understood what's the issue is present here 😃

from notify-plugin.

w20k avatar w20k commented on July 23, 2024

Darn, @LukeTowers, same for me. Used it few times, but with rules.

from notify-plugin.

w20k avatar w20k commented on July 23, 2024

@amjadniazi48, @saulo-silva, @vdomah, @web-studio-51, @BahodurSaidov, for your information.

Will be closing this ticket. As I've understood from the code base, the plugin doesn't support cases where only a root condition is enabled.
You need to specify one or more conditions.

And if it's not the case, please open a new ticket with description and steps to reproduce.

As for hacks: @web-studio-51
If you want to have this supported in the core of this plugin - Feel free to make a PR.
Or an error showing that single conditions should be added.

from notify-plugin.

LukeTowers avatar LukeTowers commented on July 23, 2024

@w20k I think this needs to be corrected with an improvement to the error message. In this case the user has a root condition, but no actual subconditions to evaluate, thus the message is incorrect and confusing.

from notify-plugin.

LukeTowers avatar LukeTowers commented on July 23, 2024

Will re-open until the message gets improved.

from notify-plugin.

Balex70 avatar Balex70 commented on July 23, 2024

i had same issue with automatic user activation by sending mail...
Something wrong with UserPlus plugin, it seems that some notification rule is created by the plugin without any rule_conditions...
Temporary solution would be to disable UserPlus plugin and disable Rain.notify plugin, but enable back notify plugin , all from backend...
This worked for me... wasted couple of hours searching though

Faced problem with error message "Notification rule is missing a root condition", tried solution explained above. But turned out, in this case, I can't create notification rule at all. After enabling UserPlus again and hit "Notification rules" in settings area I got fresh default rule with wrong template naming "welcome". And I can't create a new rule because of that.
And every time I hit "Notification rules" in settings I got fresh default rule over and over again. Something similar was discussed here: #3

Tried to reinstall all related plugins: UserPlus, Location and Notify. Not helped.

Environment:
Ubuntu 17.10
php 7.1
Build: 446

from notify-plugin.

gusdgg avatar gusdgg commented on July 23, 2024

I also get this error message "Notification rule is missing a root condition". In my case, I found that I had only one rule in the "Notification rules" settings with root condition but two records in the "rainlab_notify_rule_conditions" table with the same class name. So, when the Notifier class fires the event it founds two records, one with root condition but another one without root condition and triggers the error. I think that one of the records was still there because a failed delete action or something. When I deleted this record the issue was fixed.

from notify-plugin.

LukeTowers avatar LukeTowers commented on July 23, 2024

Fixed by #18

from notify-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.