Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Being able to control access on panel page, variant and panel pane level is very useful, you could for instance display a custom-tailored message or not show anything at all if a translation isn't available. This patch is a CTools access plugin that let's you check if a translation is available for any translatable entity.
Comment | File | Size | Author |
---|---|---|---|
#4 | translation-access-plugin-1516202-4.patch | 5.33 KB | spotzero |
#2 | translation-access-plugin-1516202-2.patch | 5.74 KB | fabsor |
translation-exists-access-plugin.patch | 6.08 KB | fabsor | |
Comments
Comment #1
plachI like this patch, but would you explain the need to support both content and interface languages? Which use cases do you have in mind?
Quick code review:
The comment does not wrap at column 80.
Comment #2
fabsor CreditAttribution: fabsor commentedI actually didn't put that much thought into it, I just added the possible variable language settings I could think of. The attached patch removes the interface language option and only exposes the content language as an option, since I can't come up with a good use case for interface language.
Comment #3
plachI'm terribly sorry, I completely lost track of this one. Overall this looks good to me, although I didn't test it. I'll be glad to commit it if someone (icluding you :) confirms it still works. You'll earn the CTools integration component maintainership if this get in, though ;)
Wrong indentation.
We have a couple of constants defined for these now. See ENTITY_TRANSLATION_LANGUAGE_DEFAULT, ENTITY_TRANSLATION_LANGUAGE_CURRENT, ENTITY_TRANSLATION_LANGUAGE_AUTHOR. We could add the latter for consistency with settings page.
'und' should be LANGUAGE_NONE
Comment #4
spotzero CreditAttribution: spotzero commentedplach, looks like you scared him away when you dropped the "M" word ;)
I've applied the changes mentioned in comment #3, re-rolled that patch against the latest dev, and re-tested the patch.
Everything looks like its working correctly.
Comment #5
plach@spotzero:
:)
Looks good to me now, would you be confident about RTBCing this?
Comment #6
spotzero CreditAttribution: spotzero commentedDefinitely.
It worked correctly in my tests. Even if there were edge cases where this code didn't work as intend, as it add functionality without touching any existing processes or code, it can safely be merged in without needing to worry about breaking anything else.
Comment #7
plachAnd who is going to deal with any follow-up? ;)
Comment #8
spotzero CreditAttribution: spotzero commentedIf anyone reports any bugs with it, send the issues my way.
Anyone needing support should make their way to Montreal this weekend ;)
Comment #9
plachSounds reasonable :)
Committed and pushed, thanks.
Comment #10
plach