• Resolved itsmifred

    (@itsmifred)


    Hi every body, I’d like to manage subscriptions non profit association but I got a warning for each user : Warning: Undefined array key “email_roles” in?/home/clients/3db470ac3c186374a924a94534df90ab/sites/test-site.com/wp-content/plugins/bbp-style-pack/includes/subscriptions_management.php?on line?707

    do you know if Subscription management can works properly and safety ?

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter itsmifred

    (@itsmifred)

    Hi again,

    may be I found a way to fix it, do you think it’s correct ?

    I changed PHP file like this ?: 

    it was :

    function bsp_not_allowed_subscription_emails ($user_id, $user_management= false) {
    global $bsp_style_settings_email ;
    $allowable_roles = $bsp_style_settings_email['email_roles'] ;
    if (!empty ($allowable_roles) && is_array ($allowable_roles)) {

    I add isset like this : 

    function bsp_not_allowed_subscription_emails ($user_id, $user_management= false) {
    global $bsp_style_settings_email ;
    ? if (isset($array['email_roles'])) {
    $allowable_roles = $bsp_style_settings_email['email_roles'] ;
    ? ?echo $array['email_roles'];
    }
    if (!empty ($allowable_roles) && is_array ($allowable_roles)) {

    I guess I could have the need to check when bbp Style Pack will be updated ? is there a way to make update keeping this ?

    Plugin Author Robin W

    (@robin-w)

    can you give me steps to see this error – ie go into this and do that and the error occurs.

    Thread Starter itsmifred

    (@itsmifred)

    Hi Robin, before editing the file subscriptions_management.php

    I got this warning : Warning: Undefined array key “email_roles” in?/home/clients/3db470ac3c186374a924a94534df90ab/sites/test-site.com/wp-content/plugins/bbp-style-pack/includes/subscriptions_management.php?on line?707

    under each user line when I go to “subscription “

    As I said, adding code in Bold “? if (isset($array[’email_roles’])) {

    $allowable_roles = $bsp_style_settings_email[’email_roles’] ; ? ?echo $array[’email_roles’]; }

    make this warning disappear.

    So, I think it”s fixed but I worry about next update which is going probably to erase this add….

    (sorry for my poor English)

    Thread Starter itsmifred

    (@itsmifred)

    by the way, if you can clarify the following for me, I’d be happy :

    Subscribe to a Forum doesn’t make user subscriber to any topic from that Forum ?

    what’s the difference between subscribing to a topic and checking the “receive email notifications” box (which is checked by default in my case)?

    Plugin Author Robin W

    (@robin-w)

    sorry, but ‘under each user line when I go to “subscription “’ is not giving me enough info- can you say exactly what you mean front end/back end? – ie i need the EXACT steps to recreate as I am not currently seeing this

    Thread Starter itsmifred

    (@itsmifred)

    Hi again Robin,

    I guess it is clear we are talking about bbp Style Pack for bbPress and would like to attach a screenshot I did before php code modification but it’s not possible here as far as I know…

    Administration page subscriptions, you have to go in you WP admin > Forum > choose one and clic on Subscriptions… otherwise I cannot say anything else… You do not have such warning ? I did…

    Thread Starter itsmifred

    (@itsmifred)

    Hi again, I just did an update bbp Style Pack to Version 5.8.8 and the f…… warning get back ! As I thought will probably happened… I did the same code modification and it works again but I’d like not to have to do that for each update…

    Thread Starter itsmifred

    (@itsmifred)

    I understand you are this plugin author and thanks for that !!

    May be you could change line 707 of bbp-style-pack/includes/subscriptions_management.php

    which is actually :

    $allowable_roles = $bsp_style_settings_email[’email_roles’] ;

    and put on place :

      if (isset($array[’email_roles’])) {

    $allowable_roles = $bsp_style_settings_email[’email_roles’] ;

        echo $array[’email_roles’];

    }

    or is that a problem and if so, can you tell me why ?

    Best regards Robin W

    Plugin Author Robin W

    (@robin-w)

    ‘or is that a problem and if so, can you tell me why ?’

    I am one guy sat in his kitchen writing code for free in his spare time.

    This plugin has over 8000 users, and I’m not prepared to release changes based on one users suggestions.

    Hence I need to be able to replicate the error, which now you have given me the steps to know that I am doing what you are doing, I am unable to do, so I need to understand under what circumstances this error occurs so that my fix works for all not just you ??

    I have some further testing to do, but will come back

    Plugin Author Robin W

    (@robin-w)

    can you try

    global $bsp_style_settings_email ;
    	$allowable_roles = (!empty ($bsp_style_settings_email['email_roles']) ? $bsp_style_settings_email['email_roles'] : array());
    	if (!empty ($allowable_roles) && is_array ($allowable_roles)) {

    and advise if this fixes for you

    Thread Starter itsmifred

    (@itsmifred)

    English is not my mother tongue and I’m not able to put all the right nuances into my exchanges. No offense intended, I hope. I’ll give this proposal a try and, in any case, I’d like to thank you again for your work…

    Thread Starter itsmifred

    (@itsmifred)

    I tried and yes, looks to be working fine. No warning back !

    I thanks you deeply and hope you’re going to be able to put these lines in the next update pack…

    Please let me know…

    • This reply was modified 8 months ago by itsmifred.
    Plugin Author Robin W

    (@robin-w)

    hey sorry, I was a little abrupt.

    Let me know if this change works for you, it covers a number of possibilities, and should work

    Thread Starter itsmifred

    (@itsmifred)

    that was not abrupt, I understand… as I said yes it looks to be working and hope not necessary to make the change after next update ??

    Thread Starter itsmifred

    (@itsmifred)

    I tried staging and production site too and it is working as well too…

    Good night Robin W !

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Subscription management don’t works’ is closed to new replies.