Code review
The method _buildQuery
doesn't exist.
All methods that are called should exist
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?
Labels |
Added:
No Code Attached Yet
|
Title |
|
@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?
@richard67 , yes sir sorry actually I used the wrong word "feel"
@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?
@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()
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.
yes sir, I confused with your database suggestion
Please see the history I linked to...
but I have learned the new thing for the database update I will see in the repo as you suggested, Thanks @richard67
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.
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.
Hmm, the only buildQuery I can find doesn't have an underscore at the beginning and belongs to the URI library.
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.
Git blame says the J3 code line is there since import from svn into GitHub 13 years ago.
Awesome. Dead code lying around...
It seems I am already tired so a bit slow with thinking tonight.
This forum post says that the function was
function _buildQuery() {
return $this->_getListQuery();
}
LMAO!!!
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
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
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-06 20:00:38 |
Closed_By | ⇒ | PhilETaylor |
@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.
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.
@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.
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.
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
@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