Skip to content

Impossible to suppress language in editUrl for language-enabled sites? #1106

Open
@JanRomero

Description

@JanRomero

Since updating from 2.7.x I’ve noticed the language parameter appearing at the end of my query string.

The comment on Page::editUrl() states that the $options['language'] argument is optional, either specifies a concrete language or forces the current user’s language if true.

The code itself, however, forces the current user’s language by default, only overriding it if a concrete language is specified or removes it for admin pages.

$options['language'] === false does nothing. Neither does not passing the argument, because both will go into the if empty() codepath.

I believe at least passing false should drop the language from the query string. My personal dream would be for that to be the default as well, which is how I understand the phpdoc anyway.

I’m submitting this because I just like my urls clean and short, especially because I sometimes have my system send edit-links to users, and because it would help me see the page ID better at a glance.

Nothing should break because the admin already honors the user’s language setting.


TL;DR:

My proposal would be to change this line to just $language = null;.


Sorry I posted this in the ProcessWire repo earlier, GitHub’s “reference in new issue” feature sent me there… I consider this an issue as opposed to a request because it goes against the documentation as I understand it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions