User tests: Successful: Unsuccessful:
Pull Request for Issue #39820 .
Line 85 of components\com_contact\tmpl\category\default_items.php
Remove test for item is owned by current user when generating table headings, since there is no current item at this point
Create some contacts and enable users to edit their own contact details in the front end.
Enable PHP warnings.
Go to the contacts list view
Everything works but 2 PHP warnings are generated about an undefined variable
Everything works exactly the same but there are no warnings
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Front End com_contact |
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Tried to add $showEditColumn to the view class but couldn't get it to work (not very familiar with Joomla code)
It doesn't really save much since the layout has to calculate for each row anyway, using the same logic.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC. The current change is fine as it is. Further improvement if required could be done in separate PR.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-02-22 19:01:49 |
Closed_By | ⇒ | roland-d |
Thank you
While this PR addresses the warning issue, it will hide the potential logical error. Think about the following case :
core.edit.own
permission but does not havecore.edit
permission.With the proposed code, the Edit column will still being displayed but there is no contact items in the table editable, and it is not right. We could use the code like below handle it:
After that blog of code, $showEditColumn will determine if we should show edit column. I would even go further by adding $showEditColumn as a property of view class and move that logical calculation to the view to avoid too much logic handle inside the layout.