Keyword

New registered users unable to post

More
8 years 4 months ago #160050 by Rob
Hello,

I am seeing the same issue as was listed in this old thread;
www.joomlaworks.net/forum/k2-en/38675-solved-k2-comment-form-not-visible-to-registered-users?start=20

The support response said that it would be looked at and fixed. I can say that 1 1/2 years later the problem still persists. This is with K2 version 2.7.1 and Joomla version 3.6.5

The problem is quite simple to replicate. If you use the default Joomla user registration form and not the K2 registration form, the K2 user profile will not have a gender assigned upon creation. Without gender assignment a registered user is unable to post comments. The work around is to manually go to each user profile and select a gender. Once this is done, the user is able to comment. This of course is a pain with an active site.

I think an easy fix would be to create an "unassigned" option for gender and force this as default for every newly created user. That way if another registration method is used, it would have a default value and would not be prevented from posting comments. Of course another way is to dig through the code and find where the gender requirement is listed and remove it, but I am going to guess that would be a bit more involved and less desirable.

Looking forward to you response,
Rob

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 months ago #160059 by Krikor Boghossian
Replied by Krikor Boghossian on topic New registered users unable to post
Hello Rob,

I cannot replicate this issue using 2.7.2 DEV.
I created a user using Joomla!'s registration form (thus no gender) and I am able to comment any item.

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

More
8 years 4 months ago - 8 years 4 months ago #160076 by Rob
Replied by Rob on topic New registered users unable to post
Hi Krikor,

Thanks for trying it out. After a little more investigation I think I might have found the real cause. After creating a registered user via the Joomla registration form, I see that in addition to no gender, there isn't assigned a K2 Group by default. Under K2 Users, I can see the new user listed as "K2 Registered" under "Joomla! Group", but blank under "Group". I will guess this is the real problem.

When I select the new user I can see that the gender has no selection, but the "Group" is automatically changed to "K2 Registered". So I think in my experiment I was changing the gender and uknownly changing the K2 group from nothing to K2 Registered.

If this is the real issue, then my question would then be, is there a way to base commenting permissions on the Joomla! Group? Or is there a way to automatically apply a K2 Group using the standard Joomla registration form?

Thanks,
Rob
Last edit: 8 years 4 months ago by Rob.

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

More
8 years 3 months ago #160624 by Rob
Replied by Rob on topic New registered users unable to post
Hi,

I would like a response to this. For every new user to my site, I have to manually go to the K2 backend, select the new user and hit "save and close". It seems like an easy fix for K2 to auto fill a new user's K2 group with the Joomla group name.

Thanks,
Rob

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #160642 by Krikor Boghossian
Replied by Krikor Boghossian on topic New registered users unable to post
Is K2's user plugin enabled?
Without this plugin Joomla!'s users cannot be synchronised with K2.

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

More
8 years 3 months ago #160672 by Rob
Replied by Rob on topic New registered users unable to post
Yes it is enabled. I can manually synchronize using the "Import Joomla! users" button. That is not my issue.

https://goo.gl/photos/YcnEjnEtEWpUqCo19

The problem is at the time of new user registration. The K2 Group defaults to "" when I believe it would make more sense to default to the assigned Joomla! Group.

This is what I see when a new user is created;

https://goo.gl/photos/ratuDgdU2gZBaE4n6

If I select the user, you can see the Joomla! Group value is automatically selected (and on a side note the gender is also undefined by default). If I simply hit save, it is assigned correctly. If I hit cancel it goes back to being undefined.

https://goo.gl/photos/ERbxxnkzMcLWUNCK8

I have to use this manual step every time a new user registers otherwise they are unable to post comments on the K2 articles. Hopefully that makes the problem clear.

-Rob

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

More
8 years 3 months ago #160793 by Rob
Replied by Rob on topic New registered users unable to post
Hi Krikor,

Is it clear what my issue is? If so have you be able to replicate it?

Thanks,
Rob

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 3 months ago #160810 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic New registered users unable to post
Hi Rob,
This parameter is responsible for the group that is automatically assigned to new registrants, did you configure it properly?
http://imgur.com/a/uM88B

Maybe you have created a K2 group before to be the default and removed it later without changing this parameter?!

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
8 years 3 months ago #160831 by Rob
Replied by Rob on topic New registered users unable to post
Thanks for the info Mohamed. Can you re-post the image? For some reason, the link you posted doesn't work for me. I'll give it a look when I see what you are referencing.

-Rob

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 3 months ago #160832 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic New registered users unable to post
Hi Rob,

Seems it is a problem with imgur.com in general.
Anyway, the image is a screenshot for the parameter, you can find it in K2 Parameters > Advanced, the label is "Select the default K2 User Group for new registrations"

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
8 years 3 months ago #160833 by Rob
Replied by Rob on topic New registered users unable to post
Hi Mohamed,

I can see your image now. Yes, that value is set. But is that value used if the K2 user profile is disabled? Again, I am using the standard Joomla! registration page, not the K2 template.

Thanks,
Rob

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 3 months ago #160834 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic New registered users unable to post
I think no, you need to register using K2 registration form in order to assign this group properly.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
8 years 3 months ago #160835 by Rob
Replied by Rob on topic New registered users unable to post
Ok, yes. This is exactly the problem I am trying to get resolved. Let me restate again.

My request is that I would like to use the standard Joomla! registration template and still allow registered users to comment on K2 items without having to manually set the K2 group. You seem to confirm that currently this is not possible. My suggestion is to have it work this way;

When a new user is created via the Joomla! registration method, K2 adds this new user to the default group given in the advanced option you show ("default K2 default user group for new registration") regardless of the setting "Enable K2 User Profile" (which really seems to have more to do with the form template than enabling K2 profiles).

The other way to fix this would be to check the user's associated Joomla! group as well as the K2 group for proper privileges. Then it would be a simple matter of making sure that my default Joomla! group matched exactly the K2 group that has permissions to comment.

Hopefully it is clear.
-Rob

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 3 months ago #160838 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic New registered users unable to post
Hi Rob,

I can suggest a simple hack to solve this problem, you may test it on your site if you like.
The hack will be applied to the file plugins/user/k2/k2.php, find this line:
if ($mainframe->isSite() && $task != 'activate' && JRequest::getInt('K2UserForm'))

And replace it with this line:
if ($mainframe->isSite() && $task != 'activate' )

Make sure to backup the file before applying the hack.

If this works, I will make a PR to add it to K2

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
8 years 2 months ago #160840 by Rob
Replied by Rob on topic New registered users unable to post
Hi Mohamed,

Thanks for the reply. I made the change and did not see a difference in behavior. I should explain better what the failure looks like.

When a non registered user looks at a K2 article they see "Login to Post Comments".

When a registered user belonging to the correct K2 group is logged in, the comment form is shown.

In my reported scenario with a valid Joomla! registration, but with no default K2 group assigned, the comment form area is blank. I see neither the first message to login nor any part of the comment form.

-Rob

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 2 months ago #160841 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic New registered users unable to post
Hi Rob,

The change I suggested works on the registration process, it should solve the problem of not assigning a K2 group for NEW users registered using Joomla registration form.

It will not affect the current users who have registered before applying the change.

If this change works with the new users, it is possible to solve the current users problem with running an SQL statement for one time.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
8 years 2 months ago #160842 by Rob
Replied by Rob on topic New registered users unable to post
Ah ok! That was the trick. I was testing with a previously registered user. It looks to be working well, thanks! On a side note, it doesn't work if the user is created in the Joomla! back-end. I don't plan on using that method, so it shouldn't be a concern.

Thanks for the fix.

Rob

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


Powered by Kunena Forum