No Code Attached Yet
avatar PhilETaylor
PhilETaylor
6 Mar 2022

Steps to reproduce the issue

Code review
The method _buildQuery doesn't exist.

$query = $this->_buildQuery();

Expected result

All methods that are called should exist

Actual result

This is broken. Caused by bad merging from #34118 and #34060

Tagging @richard67 cause #34118 (comment)

The method _buildQuery doesn't exist.

I doubt this code even runs if no one has yet reported this?

avatar PhilETaylor PhilETaylor - open - 6 Mar 2022
avatar joomla-cms-bot joomla-cms-bot - change - 6 Mar 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Mar 2022
avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
Title
_buildQuery method doesn't exist
[4] _buildQuery method doesn't exist
avatar PhilETaylor PhilETaylor - edited - 6 Mar 2022
avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
The description was changed
avatar PhilETaylor PhilETaylor - edited - 6 Mar 2022
avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
The description was changed
avatar PhilETaylor PhilETaylor - edited - 6 Mar 2022
avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
The description was changed
avatar PhilETaylor PhilETaylor - edited - 6 Mar 2022
avatar pritam825
pritam825 - comment - 6 Mar 2022

@PhilETaylor I also feel the same, I think there is not need of _buildQuery() , but _getList() is taking three parameter, where one of them is query, so if we will remove query, then It will create the problem

avatar richard67
richard67 - comment - 6 Mar 2022

@PhilETaylor I also feel the same, I think there is not need of _buildQuery , am I right?

@pritam825 Feel? Coding is not about feeling, it is about knowledge. How can you know that there is no such method? Do you know where the source code of the database package is located?

avatar pritam825
pritam825 - comment - 6 Mar 2022

@richard67 , yes sir sorry actually I used the wrong word "feel"

avatar richard67
richard67 - comment - 6 Mar 2022

@richard67 , yes sir sorry actually I used the wrong word "feel"

@pritam825 And do you know which source code to look at to say if the method exists or not?

avatar pritam825
pritam825 - comment - 6 Mar 2022

@PhilETaylor I also feel the same, I think there is not need of _buildQuery , am I right?

@pritam825 Feel? Coding is not about feeling, it is about knowledge. How can you know that there is no such method? Do you know where the source code of the database package is located?

Sir actually I have searched in the source code there isn't any function with name _buildquery()

avatar richard67
richard67 - comment - 6 Mar 2022

Sir actually I have searched in the source code there isn't any function with name _buildquery()

@pritam825 Which source code? The one in this repository here? If so, then you've looked at the wrong place because the database stuff is located here: https://github.com/joomla-framework/database . Update: I see I was wrong at the first place, it's not a database thing.

avatar pritam825
pritam825 - comment - 6 Mar 2022

yes sir, I confused with your database suggestion

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

Please see the history I linked to...

avatar pritam825
pritam825 - comment - 6 Mar 2022

but I have learned the new thing for the database update I will see in the repo as you suggested, Thanks @richard67

avatar richard67
richard67 - comment - 6 Mar 2022

Please see the history I linked to...

@PhilETaylor But I don't see how that is related to my comment to which you've linked. Do you think the mistake came from my conflicts resolution? I don't really think so.

avatar richard67
richard67 - comment - 6 Mar 2022

The conflicts resolution was this commit: d0f3448 ... I do not see that this was not clean.

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

No idea - but today, its clearly wrong and needs attention yet again. #34060 removed it cleanly but for some reason https://github.com/joomla/joomla-cms/pull/34118/files?diff=unified&w=1 seems to have added it back - therefore it needs cleaning up yet again.

any call to `_buildquery will fatal error.

avatar richard67
richard67 - comment - 6 Mar 2022

Hmm, the only buildQuery I can find doesn't have an underscore at the beginning and belongs to the URI library.

avatar richard67
richard67 - comment - 6 Mar 2022

The same code we have in J3 here: https://github.com/joomla/joomla-cms/blob/3.10-dev/components/com_content/models/archive.php#L158 .. no idea yet if this mistake is a back integration from 4 or vice versa.

avatar richard67
richard67 - comment - 6 Mar 2022

Git blame says the J3 code line is there since import from svn into GitHub 13 years ago.

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

Awesome. Dead code lying around...

avatar richard67
richard67 - comment - 6 Mar 2022

Hmm I see ... #34060 removed the complete method ... so maybe that just needs to be done again. No idea it if was my conflicts resolution or however else that zombie came back.

avatar richard67
richard67 - comment - 6 Mar 2022

It seems I am already tired so a bit slow with thinking tonight.

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

This forum post says that the function was

function _buildQuery() {
		return $this->_getListQuery();
	}

LMAO!!!

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

yes I removed it in . #34060 but then #34118 resurrected it - both PRs were very close in date so I don't think that was me... I think it might have been your merge, but there is no evidence either way.

Fact is that there is - today - no method _buildQuery anywhere to be called - and so this code needs addressing as its dead code that could cause a fatal error.

Like you Im exhausted, so will have to revisit next week

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

So ignoring the "Files Changed" Tab ... look at the commits tab on the older PRs.

#34060 = I remove the method getData which was merged by you at 8:38pm

#34118 = I remove the method _getList f6effc7

You then merge 4.0-dev incorrectly at 8:41pm - thus resulting in adding back some code... leading to the +/- we see in the Files Changed Tab here: https://github.com/joomla/joomla-cms/pull/34118/files

So, my PRs were to remove getData and getList methods from this file, and thus we need to do that again... by removing the getData

//cc @joomdonation

avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-03-06 20:00:38
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 6 Mar 2022
avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022
avatar richard67
richard67 - comment - 6 Mar 2022

@PhilETaylor Well, after I had resolved that conflict, I had asked you to check it, and you did not notice it either, so it was not me alone.

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

It was merged three days later, without waiting for me to reply. Not my problem governor! I have no permissions to merge code! I simply offered my Pull requests be ripped apart and shredded by others, if I throw enough mud at the wall then some of it might stick and some shrivels and drys up and falls off and some people hit with sticks until it’s unrecognisable. If maintainers don’t wait for volunteers to circle back within a timescale appropriate to them, that’s the projects fault not the volunteer who presented the PR. Welcome to open source.

It’s dead code anyway. So luckily it’s not used. Unlike the major security issue in the Input libraries that is still unresolved….

Sent from my iPhone

On 6 Mar 2022, at 20:02, Richard Fath @.***> wrote:


@PhilETaylor Well, after I had resolved that conflict, I had asked you to check it, and you did not notice it either, so it was not me alone.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.

avatar richard67
richard67 - comment - 6 Mar 2022

@PhilETaylor Ok from your friendly words I have learned now that I will never again help you with solving merge conflicts in a PR or never even touch one.

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

Not your normal upbeat self?

ok I’ll add you to the list of people who universally hate me in this toxic project that I’ve dedicated twenty years of my life to… no worries. Hit the block button so you don’t receive notifications and ignore me, many have and many do.

funnily I never have these issues in other open source projects I contribute to.

I can’t help the facts. The fact is that your merge was incorrect and it was not picked up by the maintainer who merged it or myself until today - I cannot change the facts. I work on so many different projects throughout a week that 3 days is a huge timeframe to remember what I was thinking when doing a pull request! Today alone I have contributed to 7 different projects!

This is yet another reason Joomla code needs static code analysis and code quality tools - an undefined method like this would instantly be visible and alerted and it just goes to show how lacking the projects quality tools like unit testing really are. But I digress.

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

I can’t even see where in the merge the wrong change was made so - oh well - just chalk it up to one of those strange things - I have no time need to collect kid from cinema

Add a Comment

Login with GitHub to post a comment