Skip to content

Cleanups, fixes and a bit of optimizations for site/components batch #1#12290

Merged
wilsonge merged 5 commits intojoomla:stagingfrom
frankmayer:site-com_ajax-com_banners-com_config
Dec 18, 2016
Merged

Cleanups, fixes and a bit of optimizations for site/components batch #1#12290
wilsonge merged 5 commits intojoomla:stagingfrom
frankmayer:site-com_ajax-com_banners-com_config

Conversation

@frankmayer
Copy link
Copy Markdown
Contributor

  • com_ajax
  • com_banners
  • com_config

Note: This is a single commit bundling all types of changes, since PR #12261 which had detailed commits, was rejected as a whole

- com_ajax
- com_banners
- com_config
Note: This is a single commit bundling all types of changes, since PR #12261 which had detailed commits, was rejected as a whole
}
}
elseif ((is_array($categoryId)) && (count($categoryId) > 0))
elseif (is_array($categoryId) && (count($categoryId) > 0))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not remove the parenthisis on count too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

OR a.own_prefix=0
AND cl.own_prefix=0
AND $prefixCondition
SQL;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as said, i prefer using the API here, but that is just my opinion.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one i think it should be a mantainer decision.

@wilsonge please check, we normally use the api and the quoteName as PLT meeting notes.

for the rest i think it's fine now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the scope of the PLT meeting notes, but while the use of the query-builder might be OK in most cases, it might be suboptimal when queries are running in loops, like for example in the finder (indexer, lexer, etc.). My proposed way might be useful at least in such cases as the HEREDOC is also much faster than string or array concatenation via implode().

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd definitely prefer that we do. But this is code specifically for MsSQL right? I remember this being a total nightmare in the past to get sorted. We have to be much more careful here than in standard queries with the query builder.

// Get the template form.
if (!$form->loadFile($formFile, false, '//config'))
{
throw new Exception(JText::_('JERROR_LOADFILE_FAILED'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you remove one if block you have to remove one ident tab inside the if block

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know and I am doing that. That many changes, sometimes things slip through. 😄

@wilsonge
Copy link
Copy Markdown
Contributor

wilsonge commented Oct 3, 2016

This looks fine on review other than the query which I straight skipped because I need to go do some reading up on

@frankmayer
Copy link
Copy Markdown
Contributor Author

Should I revert the query change, so that this PR can go through? It's a pity that the other changes are held back because of the query.
I could then do another PR with the query change, if there is a final decision on that.

@rdeutz
Copy link
Copy Markdown
Contributor

rdeutz commented Dec 13, 2016

you should not mix Code Style, bug fixes and other changes in one PR. A PR should have one topic and nothing more that makes it easier to test and it gets merged faster

@frankmayer
Copy link
Copy Markdown
Contributor Author

Yes, the problem with that is, that for those kinds of changes, there would probably be need for hundreds of PRs (and therefore branches) if those are not somehow grouped to digestible chunks, which I tried to do with this set of PRs.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on eec22d1

code review


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

@frankmayer
Copy link
Copy Markdown
Contributor Author

Fixed some conflicts that had occurred in the meantime.
Having merged the changes of above referenced PR's made this PR lighter and easier to test.
It is essentially ready to be merged, when the team finds the time and PR is OK.

@wilsonge wilsonge merged commit edcd907 into joomla:staging Dec 18, 2016
@wilsonge wilsonge added this to the Joomla 3.7.0 milestone Dec 18, 2016
@frankmayer frankmayer deleted the site-com_ajax-com_banners-com_config branch December 25, 2016 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants