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

[5.2] Fix of unnecessary SQL query for Fields, get the field value already loaded by getFields() #42861

Merged
merged 6 commits into from
Apr 30, 2024

Conversation

Fedik
Copy link
Member

@Fedik Fedik commented Feb 23, 2024

Summary of Changes

Remove unnecessary SQL query for the custom fields, during the form rendering.
FieldsHelper::getFields() load the field value, however FieldsHelper::prepareForm() also loading them wthout a reason.
Also removed some dead code.

Testing Instructions

Enable debug and debug query.
Create a couple of Custom fields, let say 10.
Open article editing.

Actual result BEFORE applying this Pull Request

Notice amount of query in debug.
Let say 75

Expected result AFTER applying this Pull Request

The amount of query will be 10 less, 65

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

@crommie
Copy link

crommie commented Feb 24, 2024

I have tested this item ✅ successfully on 59bd3b7

Before: 61 queries. After: 51 queries.


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

@chmst
Copy link
Contributor

chmst commented Feb 24, 2024

I have tested this item ✅ successfully on 59bd3b7


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

@adj9
Copy link

adj9 commented Feb 24, 2024

I have tested this item ✅ successfully on 59bd3b7

Its ok Queries have decreased


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

@chmst
Copy link
Contributor

chmst commented Feb 24, 2024

shuldn't that go into 4.4?

@richard67
Copy link
Member

shuldn't that go into 4.4?

Good question. @Fedik Is the unnecessary query an issue in 4.4, too?

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 24, 2024
@Fedik
Copy link
Member Author

Fedik commented Feb 24, 2024

Is the unnecessary query an issue in 4.4, too?

yeap,

@richard67
Copy link
Member

Is the unnecessary query an issue in 4.4, too?

yeap,

@Fedik Then a PR should be made for 4.4-dev.

@Fedik
Copy link
Member Author

Fedik commented Feb 24, 2024

I will do another, later

@Fedik Fedik marked this pull request as draft February 24, 2024 12:56
@gilou103
Copy link

During PBF
16 Content Article - Custom fields (my Group),
before patch 67 queries, after patch 51 queries

@Fedik
Copy link
Member Author

Fedik commented Feb 25, 2024

@Fedik Fedik closed this Feb 25, 2024
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 25, 2024
@Fedik Fedik deleted the fields-fx1 branch February 25, 2024 12:01
@Fedik Fedik restored the fields-fx1 branch March 7, 2024 09:13
@Fedik Fedik reopened this Mar 7, 2024
@Fedik Fedik marked this pull request as ready for review March 7, 2024 09:14
@richard67
Copy link
Member

I've restored the previous human test results as the PR was closed but then reopened, and there was no change since the successful tests.

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 9, 2024
@bembelimen bembelimen changed the base branch from 5.1-dev to 5.2-dev March 17, 2024 15:41
@bembelimen bembelimen changed the title [5.1] Fix of unnecessary SQL query for Fields, get the field value already loaded by getFields() [5.2] Fix of unnecessary SQL query for Fields, get the field value already loaded by getFields() Mar 17, 2024
@bembelimen
Copy link
Contributor

I moved it to 5.2 as a decision from maintainer

@Quy Quy removed the PR-5.1-dev label Mar 17, 2024
@pe7er pe7er self-assigned this Apr 23, 2024
@pe7er pe7er enabled auto-merge (squash) April 30, 2024 07:49
@pe7er pe7er merged commit ef41412 into joomla:5.2-dev Apr 30, 2024
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 30, 2024
@pe7er
Copy link
Contributor

pe7er commented Apr 30, 2024

Thanks @Fedik !

@Fedik Fedik deleted the fields-fx1 branch April 30, 2024 09:05
@Quy Quy added this to the Joomla! 5.2.0 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants