While ago I wrote a tiny module for localized web sites. Frequently different users have different language preferences. Not anyone, for example, is satisfied with administration pages translation.

This creates an inconvenience, namely, all automatically generated path aliases are invisible to such users, they see regular /node/xxx.

This module solves this by fixing all the aliases to be language neutral.

Initially I have no plans to releasing it. But, surprisingly, many people found it useful and advised me to do it in order to ease the installation process. http://drupal.org/node/1788774

Module sandbox page:

http://drupal.org/sandbox/akamaus/1420990

Git repository:

git clone http://git.drupal.org/sandbox/akamaus/1420990.git

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxakamaus1420990git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

beljaako’s picture

Hi Akamous,

Some things to point out to start out with:
- You are working on the master branch: How you should switch
- I checked your code and I think its to small to consider it a module to apply for full project access. If I recall correctly about 150 lines of code is the minimum. Maybe you could expand the module with some more features and settings applicable on the path module.
- See post by PA robot, your code misses out on a lot of comment and other requirements.

akamaus’s picture

Status: Needs work » Needs review

@beljaako, thanks for the feedback.

I've added some functionality, made a configuration page for module. Also I fixed all the warnings as suggested by PA robot and changed the git branch.

Hope anyone has a time to review my work.

dimitrov.adrian’s picture

Seems to be a good one now. Works as fine on my local test. Readme file looks good. Just one suggestion for codding. Prefere to init the variables first.

function neutral_paths_menu() {
$items['admin/config/search/path/language_settings'] = array(

may be:

function neutral_paths_menu() {
$items = array();
$items['admin/config/search/path/language_settings'] = array(

Cheers!

akamaus’s picture

@dimitrov.adrian, thanks for the suggestion. Fixed now.

jamesoakley’s picture

Status: Needs review » Needs work

Hi Akamaus

I noticed a couple of things.

1. I'm not sure I understand the project page - is there any way you can make clearer what the use case for this would be? More specifically, I don't understand what you mean by "language neutral paths". Perhaps an actual example of a node, and what the confusion might be, would help?

2. Perhaps this reflects my misunderstanding (my comment above) - the .info file states that the project is dependent on node, user and taxonomy. Node and taxonomy will be required on every Drupal 7 site, so those dependencies are redundant. But given this is about rewriting aliases, does it need to be dependent on the Path module? And given this is about translated websites, is i18n another dependency?

3. Getting into the code itself: The neutral_paths_admin function defines an admin form. On there, there is a form element named np_fix_new which sets up a series of checkboxes in which the user can define which kinds of site components are to be handled by the module. The default value to be loaded is the contents of the variable neutral_paths_fix_new. The form element and the variable name should match if the admin form is to contain the applied settings the next time it is loaded.

Hope that is some help

akamaus’s picture

Status: Needs work » Needs review

Hi James,
thanks for the attention.

1. I've rewrited the module page. Hope, it's much clear now.

2. I removed the dependencies on required modules. Strictly speaking, path module is not a dependency, it doen't create url_alias table I'm working with. But it displays a list of paths and their language settings which complement the statistics I display, so I added it as a dependency.

3. I'm not sure whether you asked to me to fix a style or a bug. Code worked perfectly for me as it was. Still I agree that element differs from others so I renamed it to match the name of a variable.

jamesoakley’s picture

I'm still being really slow.

Imagine someone has a site and has set up a localisation for that site in French.

What problems does that cause with URL aliases? How does this module help?

akamaus’s picture

Status: Needs review » Needs work

Ok, I'll speak for myself. Say, I'm working on a site for Russian-speaking auditory. So all the pages are in Russian. Unfortunately, drupal-related terminology hasn't settled yet, so the quality of translation of admin pages leaves much to be desired. Also I want to be able to communicate with an international community. So I switch language of admin and moderator accounts to English. Unfortunately, now aliases of newly created nodes would have language set to English. So they would be unavailable to site visitors (the default language is Russian). Similarly, admin can no longer access older nodes by their aliases.

All this was a major headache which is solved by the module. There was a lengthy thread while ago about incorporating this functionality to pathauto, but maintainers refused to do so. Please, take a look the following post. Author seems to be more clear than me. http://drupal.org/node/1234924#comment-6509392

akamaus’s picture

Status: Needs work » Needs review
federiko_’s picture

Status: Needs review » Needs work

Hello. I tested your module and have a few things to say.

After installing the module, the first comment I can make is that the interface is a little bit confusing. I didn't really understood the purpose.

I don't really understood what was "Language neutral node path aliases" because when I click on reset button I saw no changes in path aliases. Only the language of the node is changed.

I think there is something to clarify there

Other little stuffs :

- In your .info file I think you could put a dependency to Locale module
- Precise how it works, may be adding some descriptions in the interface.
- "Language neutral node path aliases" and "node paths language" : i think you talk about languages prefixes.
- Will you develop taxonomy and users functions ?

stborchert’s picture

Status: Needs work » Reviewed & tested by the community

@federiko_: I guess you misunderstood the purpose of this module.

It does not alter or modify path prefixes but ensures all aliases (of the configured types) are set to "Language neutral". This way you can access the path allias even if you display the page in a different language.

Example:
* content is created with language "german"
* user has configured to view the site in english

By default, Pathauto would create the alias to the content only for language "german" so the user would have no access to it. Neutral paths allows you to create the aliases as "Language neutral" so it is accessible even if the site language is different from the content language.

I found no major coding standard violations, the module is working as expected (at least as expected by me), so "Reviewed and tested".

@akamaus: We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.

*Minor notes*
Maybe you could re-phrase "Language neutral {type} path aliases" to "Number of {type} path aliases set to Language neutral".

siliconmind’s picture

This module saves me a lot of time! It should be a part of core or at least pathauto. All sites I run use english language for administration pages but content is always in other languages. Such configuration is a real pain in D7.

The D7 idea of returning 404 on EXISTING aliases is just pure nonsense. Language shouldn't have anything to do with accessibility of content. A path must be accessible always regardless of selected language. This module fixes this issue and is a must have tool for every site that uses more than one language.

Great work!

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

In _neutral_paths_admin_form_part() you are using a LIKE query to count the number of aliases - are you guaranteed that the path sources will always start with node/ user/ or taxonomy/ ? And why just those three, wouldn't it be easier to support path aliases at the entity level?

Otherwise, this module looks nice and useful!

Thanks for your contribution, akamaus!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

----
Top Shelf Modules - Crafted, Curated, Contributed.

rolfo85’s picture

Hi,

I have a problem. I work with Entity Translation and neutral_paths.
For default setting i have checked the language fallback.
I have a new contents for default language in italian and the alias work correctly because are the same of italian language (also in the other languages, english for example).

Example:

"Chi siamo" (new contents created in italian language and not translated in other languages)
alias: "chi-siamo" (the alias is the same in all languages) Perfect !

The problem

If i translate the node "Chi siamo" in english for example, the result will be "About us" and the alias will be "about-us" good ! BUT.... if i switch to the italian languages, the node "Chi siamo" will have the alias "about-us" not "chi-siamo" .

Every translation of node that will be editing, will have the same alias shared in 2 languages. This things is correctly only if i don't have translations.

Can you help me ?

jamesoakley’s picture

@rolfo85 - this issue (this page on the Drupal website) is only about whether or not this project should become a full project on drupal.org

If you have an issue with the way the module works, I'd suggest opening a separate issue and asking your question there. You rarely get the help you are looking for by tagging your question onto the end of another issue - unless that other issue is about precisely your problem.

https://drupal.org/node/add/project-issue/1420990 is what you're looking for.

Status: Fixed » Closed (fixed)

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

Nux’s picture

A stupid question probably - but where is the download link for this module? I search and search, but I just keep going back to this sandbox and there is no download link there.

Edit: Never mind I've found GIT repo. The URL seem to have changed and is now:
http://drupalcode.org/sandbox/akamaus/1420990.git

I just used one of the first versions which just keeps pathauto aliases language neutral. Not sure what is the status of the latest version...

jamesoakley’s picture

This issue was fixed, which means that the opening poster was given permission to promote their sandbox project to a full project on drupal.org. However, in this case, they've never done so, so the project is still a sandbox one. Sandbox projects do not have releases that can be downloaded, because they are only intended for testing. You could download it via git from the Sandbox, but it appears to be unsupported so you wouldn't have the safety of knowing the Drupal Security Team will take responsibility for it's ongoing safety.