- Posts: 11
COMMUNITY FORUM
New registered users unable to post
- Rob
-
Topic Author
- Offline
- New Member
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
-
- Offline
- Platinum Member
- Posts: 15920
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.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
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
Please Log in or Create an account to join the conversation.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
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
-
- Offline
- Platinum Member
- Posts: 15920
Without this plugin Joomla!'s users cannot be synchronised with K2.
Please Log in or Create an account to join the conversation.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
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.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
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
-
- Offline
- Platinum Member
- Joomla Developer
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.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
-Rob
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
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.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
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
-
- Offline
- Platinum Member
- Joomla Developer
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.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
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
-
- Offline
- Platinum Member
- Joomla Developer
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.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
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
-
- Offline
- Platinum Member
- Joomla Developer
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.
- Rob
-
Topic Author
- Offline
- New Member
- Posts: 11
Thanks for the fix.
Rob
Please Log in or Create an account to join the conversation.