Skip to content

Conversation

@nordmograph
Copy link

The method loads the profile info for the linked user even when no user is linked ($contact->user_id == 0), loading unnecessary stuff (UserModel, form, data, plugin) for nothing.

Pull Request for Issue # .

Summary of Changes

Conditions the request of Contact Linked profile data and functions to the existence of a linked user

Testing Instructions

Create a contact item and test linking it or not to a user

Actual result BEFORE applying this Pull Request

  • Loads profile information from a id = 0 user to bind it to contact

Expected result AFTER applying this Pull Request

  • Doesn't load profile information to bind to contact
  • Still works for a contact item linked to existing user , loading profile data and binding to contact

Link to documentations

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

The method loads the profile info for the linked user even when no user is linked ($contact->user_id == 0), loading unnecessary stuff (UserModel, form, data, plugin) for nothing.
@richard67 richard67 changed the title Do not get the profile info for the linked user when no user is linked [5.4] Do not get the profile info for the linked user when no user is linked Nov 3, 2025
@ceford
Copy link
Contributor

ceford commented Nov 4, 2025

I have a problem! I created a contact named Nobody and left all of the fields blank. It is in Category: Sample Data-Contact and is Featured. I see it in a list of featured contacts along with two others. Selecting the link throes a 404 page with this call stack:

 # 	Function 	Location
1 	() 	JROOT/libraries/src/Router/Router.php:166
2 	Joomla\CMS\Router\Router->parse() 	JROOT/libraries/src/Application/SiteApplication.php:767
3 	Joomla\CMS\Application\SiteApplication->route() 	JROOT/libraries/src/Application/SiteApplication.php:243
4 	Joomla\CMS\Application\SiteApplication->doExecute() 	JROOT/libraries/src/Application/CMSApplication.php:304
5 	Joomla\CMS\Application\CMSApplication->execute() 	JROOT/includes/app.php:58
6 	require_once() 	JROOT/index.php:51 

Comparing two links:

http://localhost/joomla-cms5/index.php/en/contact-component/contact-categories/park-site/webmaster
http://localhost/joomla-cms5/index.php/en/contact-component/contact-categories/nobody

Ah! Wrong parent category.

So with that fixed, the difference is ... what?

I see exactly the same result with and without the patch applied. And with and without a linked user.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46398.

@richard67
Copy link
Member

So with that fixed, the difference is ... what?

I see exactly the same result with and without the patch applied. And with and without a linked user.

@ceford As far as I understand this PR, there should not be a visible difference. Everything should work as well as before for the 2 cases (contact item without a linked user, and contact item with a linked user).

@ceford
Copy link
Contributor

ceford commented Nov 7, 2025

I have tested this item ✅ successfully on af75ef3


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46398.

@muhme
Copy link
Contributor

muhme commented Nov 7, 2025

I have tested this item ✅ successfully on af75ef3

Tested with JBT

  • Created contact 'no user' without linked user in category 'Uncategorised'
  • Created menu item 'contacts' in 'Main Menu' with 'List Contacts in a Category 'Uncategorised'
  • Jome Dashboad > Global Configuration > Debug System > Yes
  • Site frontend > 'contacts' > 'no user' seen 38 database queries

Applied PR with Patch Teser

  • database queries reduced to 33

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46398.

@muhme
Copy link
Contributor

muhme commented Nov 7, 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46398.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-5.4-dev RTC This Pull Request is Ready To Commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants