×
Kunena 5.2 Beta 1 Released (24 Sep 2020)

The Kunena team is thrilled to announce the first public beta release of Kunena 5.2, a native Joomla extension for Joomla 3.9. This is a development release and should be only be used for testing; this version is not recommended for live websites at this stage.

The purpose of this release is to encourage testing by downloading, installing and identifying any problems or shortcomings that people may discover. K 5.2.0 B1 is stable and we are aware that people will discover defects. We encourage you to use the forum to report defects, as soon as they are discovered, so that the development team can work through the problems before the release of K 5.1 as a stable product. Reporting defects does not mean that the problems can or will be fixed. The Kunena team is looking forward to hearing your feedback on how well we have achieved our design goals.

Solved Blue Eagle is always subscribing users to topic

More
4 years 3 months ago - 4 years 3 months ago #1 by TomasFC
Hi,

When I upgraded to Kunena 4.0.11 I noticed that users were automatically being subscribed to a topic when they replied. The configuration settings were unchanged in the upgrade (as it should) remaining as:
"subscriptionschecked":"0",

Yet the checkbox would show up checked when replying to a topic that the user was NOT subscribed to.

This to me generates an unnecessary volume of emails that I don't want.

I looked through the code and found the solution (I think, at least so far so good).

In the file
components/com_kunena/template/blue_eagle/html/topic/edit.php

Line 176

Reads:
<input style="float: left; margin-right: 10px;" type="checkbox" name="subscribeMe" id="subscribeMe" value="1" <?php if ($this->subscriptionschecked == 1 && $this->me->canSubscribe != 0 || $this->subscriptionschecked == 0 && $this->me->canSubscribe == 1)

When it should read:
<input style="float: left; margin-right: 10px;" type="checkbox" name="subscribeMe" id="subscribeMe" value="1" <?php if ($this->subscriptionschecked == 1 && $this->me->canSubscribe != 0 || $this->subscriptionschecked == 1 && $this->me->canSubscribe == 1)

The issue being:
subscriptionschecked == 0

What this is saying is that if user is NOT subscribed and can subscribe, then check the box/subscribe them.

When it should be saying is that if user IS subscribed and can subscribe, then check the box/subscribe them.

If they are not subscribed the check box should be unchecked, allowing them to check it if they please, but by default should be unchecked.

So I've changed that 0 to a 1, and it seems to work fine. I don't know if there are other places where this should be changed as well.

Please let me know if there are any issues with this.

Thank you, hope this helps,
Tomás

This message contains confidential information

Database collation check: The collation of your table fields are correct

Joomla! SEF: Enabled | Joomla! SEF rewrite: Disabled | FTP layer: Disabled |

This message contains confidential information
htaccess: Exists | PHP environment: Max execution time: 30 seconds | Max execution memory: 64M | Max file upload: 4M

Kunena menu details:

Warning: Spoiler!

Joomla default template details : rt_clarion_responsive | author: RocketTheme, LLC | version: 1.8 | creationdate: October 8, 2014

Kunena default template details : Blue Eagle | author: Kunena Team | version: 4.0.11 | creationdate: 2016-06-05

Kunena version detailed: Kunena 4.0.11 | 2016-06-05 [ Barcelona ]
| Kunena detailed configuration:

Warning: Spoiler!
| Kunena integration settings:
Warning: Spoiler!
| Joomla! detailed language files installed:
Warning: Spoiler!

Third-party components: CommunityBuilder 2.0.14 | UddeIM 3.9

Third-party SEF components: None

Plugins: None

Modules: None

Last edit: 4 years 3 months ago by TomasFC.

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #2 by sozzled

TomasFC wrote: When I upgraded to Kunena 4.0.11 ...

May I ask you, what version of Kunena were you using before you observed this problem? The problems you refer to commenced in K 4.0.5 and we discussed them >>> here <<<

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago - 4 years 3 months ago #3 by TomasFC
I was on version 4.0.3.

I did not see that thread, even when I searched... :blink:

This is what that same file had (Lines 167 to 177):
<?php if ($this->canSubscribe()) : ?>
		<tr id="kpost-subscribe" class="krow<?php echo 1 + $this->k^=1;?>">
			<td class="kcol-first">
				<strong><?php echo JText::_('COM_KUNENA_POST_SUBSCRIBE'); ?></strong>
			</td>
			<td class="kcol-mid">
				<input type="checkbox" name="subscribeMe" id="subscribeMe" value="1" <?php if ($this->subscriptionschecked == 1) echo 'checked="checked"' ?> />
				<label for="subscribeMe"><i><?php echo JText::_('COM_KUNENA_POST_NOTIFIED'); ?></i></label>
			</td>
		</tr>
		<?php endif; ?>

In re-reading the code, I see that there is a redundancy after my alteration. I'm not sure the statement after the OR ( || ) is needed, even if the values could be -1, 0 or 1.

Tomás
Last edit: 4 years 3 months ago by TomasFC.

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #4 by 810
No the code is right.

your setting is: subscriptionschecked = 0 (the checkbox is not selected by default)

So we look at the second param:
$this->subscriptionschecked == 0 && $this->me->canSubscribe == 1

We can skip the first part, we know that the setting is "0".

Now we come on the user setting.

If the user has enable the option "Select subscription as default" on profile->edit->Forum settings

there you can have 3 options:

1) default = -1
2) Off = 0
3) On = 1

there we see $this->me->canSubscribe == 1, so only if you have turned it on, the box is selected.


So you need to tell your users to change their setting, or you resetting all users their setting, but know that if you change it, nobody get any notifications anymore

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #5 by TomasFC
Sorry, but it's wrong.

The statement is saying that if the subscriptionschecked is 0 then default subscribe the user when he replies to the topic.

And as I understand it, that is the whole point of the "subscriptionchecked" If I set it in the configuration file to 0, I understand it to mean that the default option of the checkbox will NOT be checked. and if it is 1 then, the default check box will be checked.

The code as you wrote it would not allow me to have that box unchecked.

The -1 comes in for the "undecided" users as I see it. If they are undecided on that subscription and the subscriptionschecked is 1, then they will default to checked, but if they have already unsubscribed (0) then it will not show checked as default, even with the subscriptionschecked=1.

Now having seen that, as I said above my change created a redundancy.

Tomás

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #6 by 810
Half true, the "subscriptionchecked" is the default option for "New" users.

Users are in control if they want to get notifications, not the website owner.

If a user want to change this option, then they can do it on their profile setting.


If you want to disable the option, then you need to do a sql query that set the option to -1 or 0.

Then hide the option by css.

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #7 by sozzled

810 wrote: If a user want to change this option, then they can do it on their profile setting.

That's true, unless the users are using Community Builder :whistle:

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #8 by 810
Then you can change that on the cb users settings ;)

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #9 by TomasFC
OK, I think I know what the issue is and what I wasn't understanding.

First I like to say that Kunena is an amazing software and I've been using it since 2009.

The change I made has solved my issue. However, I understand that it's not right for every situation.

This "bug" was pointed out to me by a user after the upgrade.

i notice, when i post something, it automatically subscribes me to the topic? Was that intentional? as previously this was not the case, and i could subscribe only to the topics i wanted to keep track of...

thanks Tomas

Message

You have been subscribed to this topic.
Your message has been successfully posted.


I then tested this and the same happened to me for every topic I tried.

I made the change of code and my issue was solved.

It's important to mention that I have always used CB and I've never given users (I didn't know how) the option to modify their "canSubscribe" setting. In looking at the database, every user's setting for "canSubscribe" is "1". I've never changed this value.

Given this, with the changes in the new template, I have NO option in configuration settings to have the default setting for the checkbox unchecked, neither do the users.

My choice is to have users subscribe to a topic, only when they make the effort to check the box. Most users are unaware of the checkbox when they reply to a topic.

Should users on an individual basis want to have the subscription by default for every topic they reply to, I could enable that in the future, but it's never been an option so far.

So since the canSubscribe setting is "1" for every user, and users don't have the option to change it, that line of code as it was, invalidates the option in the settings for subscriptionschecked variable.

Given all this, I should run a query to change all values to -1 for the cansubscribe value so that on the next update I don't have the same issue again.

Thank you,
Tomás

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #10 by 810
the sql for that is:
UPDATE `yourprefix_kunena_users` SET `canSubscribe` = '-1'

change the yourprefix with yours.
The following user(s) said Thank You: TomasFC

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.123 seconds