Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access = 0 for custom component objects #119

Closed
iantrudell opened this issue Jan 2, 2023 · 3 comments
Closed

access = 0 for custom component objects #119

iantrudell opened this issue Jan 2, 2023 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@iantrudell
Copy link

I'm trying to convert my custom Joomla component plugin to work with the Joomla 4 version of JComments, but when I rebuild the #__jcomments_objects table, the "access" column is always 0 for every row related to the custom component, while the com_content and other default components show access = 1.

How do I make it so that newly submitted comments on my custom component's pages have access = 1 in the #__jcomments_objects table? I do not see anywhere in the Admin Control Panel to set the ACL for custom components/plugins like I could per-language in the Joomla 3 version.

@Globulopolis
Copy link
Collaborator

access field isn't related to ACL. It's a group access(Public, Registered, Guest, etc.).
This field going from jcomments plugins components\com_jcomments\plugins\. And another place where the field could be set is JCommentsObject::storeObjectInfo() helper and class JCommentsObjectInfo in classes folder. At least I have tested this piece of code with community builder component and this field = 0 too. But I can see the comment in user profile.

I'm not sure for 100% but you can try to set up the default value of this field in https://github.com/exstreme/Jcomments-4/blob/master/component/site/classes/objectinfo.php#L43 From null to 1.

@iantrudell
Copy link
Author

iantrudell commented Jan 3, 2023

access field isn't related to ACL. It's a group access(Public, Registered, Guest, etc.). This field going from jcomments plugins components\com_jcomments\plugins\. And another place where the field could be set is JCommentsObject::storeObjectInfo() helper and class JCommentsObjectInfo in classes folder. At least I have tested this piece of code with community builder component and this field = 0 too. But I can see the comment in user profile.

I'm not sure for 100% but you can try to set up the default value of this field in https://github.com/exstreme/Jcomments-4/blob/master/component/site/classes/objectinfo.php#L43 From null to 1.

Setting the value for access to 1 seemed to work in the plugin, but now I'm getting an issue where new comments are duplicated 7 times in the backend, and 7 times in the mod_comments_latest module:

duplicate_comments

However, in the database "#__jcomments" table they are only listed once:
jcomments_database_table

But in the database table "__jcomments_objects" there are 7 rows, one for each language:
jcomments_database_table_objects

How do I make sure that in the backend ACP's comments list, and in the frontend mod_comments_latest module, that it only displays once instead of many times? It would appear that when it Rebuilds Objects, it is rebuilding with the incorrect language?

@Globulopolis Globulopolis added the help wanted Extra attention is needed label Jan 7, 2023
@Globulopolis Globulopolis added the bug Something isn't working label Jan 11, 2023
@exstreme
Copy link
Owner

Hello! You should clear incorrect values manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants