Problem/Motivation

if (!$language->isLocked() && $language->getWeight() > $max_weight) {
  $max_weight = $language->getWeight();
}

Proposed resolution

Use max()

Remaining tasks

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

dawehner’s picture

Issue tags: +Quickfix

.

rpayanm’s picture

Assigned: Unassigned » rpayanm
Status: Active » Needs review
FileSize
738 bytes

Working on this...

YesCT’s picture

Assigned: rpayanm » Unassigned

Thanks. That looks good.

was there something else you wanted to work on? unassigning since it was green and want to be able to continue to move this issue forward. comment here or ping me irc if you were in the middle of something.

YesCT’s picture

Status: Needs review » Needs work

I'm not sure how many places we want to look for patterns like that, but I think we can do both that were in #2304403: Convert language:weight into a protected property.

There is another in ConfigurableLanguageManager.

rpayanm’s picture

Status: Needs work » Needs review
FileSize
1.79 KB

fixed :D

YesCT’s picture

thanks.

--
I took a look at the patch.

+++ b/core/modules/language/src/Tests/LanguageConfigurationTest.php
@@ -167,14 +167,14 @@ protected function checkConfigurableLanguageWeight($state = 'by default') {
-  protected function getHighestConfigurableLanguageWeight(){
+  protected function getHighestConfigurableLanguageWeight() {

out of scope for this issue.

--
the rest looks ok.

--
Note https://drupal.org/documentation/git/interdiff is really nice when working on an issue that has a previous patch. It really helps reviewers.

rpayanm’s picture

FileSize
1.55 KB
694 bytes

sorry, here the patch and interdiff for you last correction :)

YesCT’s picture

Status: Needs review » Reviewed & tested by the community

this looks super. improves just the two from the other patch that @dawehner spotted.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 8b24674 and pushed to 8.0.x. Thanks!

  • alexpott committed 8b24674 on 8.0.x
    Issue #2350941 by rpayanm | dawehner: Simplify $language max weight code...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.