Postponed on #2420737: Differences in dynamic language names are confusing in views, content, etc..
Here's the definition of LANGUAGE_TYPE_URL in locale_language_types_info()
(see: http://api.drupal.org/api/drupal/modules!locale!locale.module/function/locale_language_types_info/7)
LANGUAGE_TYPE_URL => array(
'fixed' => array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_URL_FALLBACK),
),
Is there a particular reason why it doesn't have a name and description? This is a problem whenever someone wants to make this language type configurable.
Comment | File | Size | Author |
---|---|---|---|
#18 | d7_views_language_after_patch.jpg | 46.74 KB | poker10 |
#18 | d7_views_language.jpg | 96.4 KB | poker10 |
#18 | d9_views_language.jpg | 115.76 KB | poker10 |
#18 | after_patch_cconfigurable.jpg | 269.67 KB | poker10 |
#18 | before_patch_configurable.jpg | 307.08 KB | poker10 |
Comments
Comment #0.0
a.ross CreditAttribution: a.ross commentedAdd anchor
Comment #0.1
a.ross CreditAttribution: a.ross commented*sigh*
Comment #1
David_Rothstein CreditAttribution: David_Rothstein commentedYes, this leads to PHP notices/etc in that case. Since 'name' and 'description' are required, core should be providing them even if it does not make this language type configurable by default.
Here are patches for Drupal 7 and 8.
Comment #2
David_Rothstein CreditAttribution: David_Rothstein commentedActually the hook documentation isn't quite clear about whether they're required or not, but either way it seems like they should be provided.
Comment #3
Fabianx CreditAttribution: Fabianx commentedRTBC, makes sense.
Comment #4
Gábor HojtsyThis will make the URL method available in views as well, probably confusing users (because you cannot configure this one and URL language does not appear anywhere else but in views then). See #2420737: Differences in dynamic language names are confusing in views, content, etc. for the issue discussing whether to display non-configurable language types in views and the reasons we do so now and distinguish between types with and without names instead. I think #2420737: Differences in dynamic language names are confusing in views, content, etc. would ideally be resolved sooner or elevated in priority if this one is committed.
Screenshot with this patch:
Comment #5
Gábor HojtsyI think we have a workable idea at #2420737: Differences in dynamic language names are confusing in views, content, etc., can you help implement?
Comment #6
Gábor Hojtsy#2420737: Differences in dynamic language names are confusing in views, content, etc. finally landed. This should be good to go again.
Comment #7
Gábor HojtsyI manually tested and this still applied and did not affect the views language list negatively anymore (thanks to #2420737: Differences in dynamic language names are confusing in views, content, etc.), so should be good to go. Yay!
Comment #8
alexpottCommitted c13aadd and pushed to 8.0.x. Thanks!
Comment #10
Gábor HojtsySuperb :) Thanks all!
Comment #11
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedReuploading the Drupal 7 patch from #2, with the do-not-text prefix removed.
Not sure if there is a similar issue with Views in Drupal 7 as there was in Drupal 8....
Comment #12
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedExcept for needing to check that, this is RTBC.
Comment #18
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedPatch #11 still applies to D7. I have tested it manually (with
LANGUAGE_TYPE_URL
set as configurable) and it seems working - see screenshots.before_patch_configurable.jpg - Before patch - PHP warnings and missing name and description
after_patch_cconfigurable.jpg - After patch - no warnings and table data are displayed correctly
To the views - it seems like that in D7 the language configuration is different. There are three general options before and after the patch is applied (current user's language, default site language and language neutral). So I do not see any negative impacts of this patch here either.
d9_views_language.jpg - Views language settings in D9
d7_views_language.jpg - Views language settings in D7
d7_views_language_after_patch.jpg - Views language settings in D7 after applying the patch
So +1 to RTBC.
Comment #19
mcdruidThanks for doing the follow-up testing with views in D7.
This LGTM!
Comment #21
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedThanks! Commited and pushed to 7.x.