Problem/Motivation

Code isn't using PHP's default argument values... am I missing something?

Proposed resolution

Let use PHP's default argument values.

Remaining tasks

Review patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jantoine’s picture

Status: Active » Needs review
FileSize
710 bytes

Patch attached!

DamienMcKenna’s picture

Status: Needs review » Closed (works as designed)

The reason for this is to cover for when the language string is passed in as an empty string, Metatag doesn't like that so changes it to LANGUAGE_NONE.

jantoine’s picture

This seems like a case where we should be validating the language in all cases, not just if an empty string is passed in. What happens if someone passes in a language that doesn't exist or is not enabled in Drupal?

DamienMcKenna’s picture

Title: Default argument values » Verify languages exist
Status: Closed (works as designed) » Active

You have a reasonable point, we'll see what we can do about improving the language validation.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
662 bytes

What do you think of this?

DamienMcKenna’s picture

FileSize
1.15 KB

Rerolled.

DamienMcKenna’s picture

FileSize
668 bytes

I accidentally included code from another patch in #6.

DamienMcKenna’s picture

Issue summary: View changes
FileSize
709 bytes

Rerolled.

DamienMcKenna’s picture

FileSize
705 bytes

Oops, the formatting was off.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Thanks.

Status: Fixed » Closed (fixed)

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