Jump to content

LanguageSupport.module, missing permission


Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By daniel_puehringer
      Hi community,

      I am using the "PageTable" Module (also called "ProFields: Page Table") and the built in "Language" Module (also called "Languages Support").

      With the help of PageTable I was able to create several content elements which should usually be displayed in German(default language) and English.

      However some Content Elements should only be shown in German and NOT in English.

      Well sounds easy, right? Not so fast. I really love this CMS, but I have not found a solution for this problem yet.
      As you can see in the screenshots attached I tried to uncheck the "active" Checkbox for the english language to completely hide the content element for english users.

      However no matter what I do the german text shows on the english page.
      If I leave the "content-should-not-be-shown-in-english"(see Screenshot Number 2) blank and save the page, the page will inherit the german page url "content-element-with-simple-text-which-should-only-be-shown-in-german".

      My question therefore is:
      How can I hide a specific content-element for only one language?

      I´m using the latest processwire & module versions.

      The code which I use to render the content elements looks like this:
      //Info: contentelements is a field of type "ProFields: Page Table" <?php foreach ($page->contentelements as $element): echo($element->render()); endforeach; ?> filename: basic-page.php

      I would really appreciate your help since I haven´t found a solution after reading through quite a lot of forum posts.

      All the best,

    • By joeck
      Hey there,
      I'm very new to Processwire but allready in love!
      So far my experience was great but I ran into an internal server Error (500) and my error logfile logged:
      Error:     Exception: Unknown language (in P:\xampp\htdocs\xxx\wire\modules\LanguageSupport\Languages.php line 343)
      (I know XAMPP is not the best developing area but for simplicity reasons I like it...)
      The line 343 in my Languages.php(unchanged by me) is:
      if(!$language instanceof Language || !$language->id) throw new WireException("Unknown language"); in the function of 
      public function setLanguage($language) { if(is_int($language)) { $language = $this->get($language); } else if(is_string($language)) { $language = $this->get($this->wire('sanitizer')->pageNameUTF8($language)); } if(!$language instanceof Language || !$language->id) throw new WireException("Unknown language"); $user = $this->wire('user'); $this->savedLanguage2 = null; if($user->language && $user->language->id) { if($language->id == $user->language->id) return false; // no change necessary $this->savedLanguage2 = $user->language; } $user->language = $language; return true; } I have no clue what the problem is and as far as I know when I closed the website the day before everything was working just fine.
      I copied the whole folder to "develop" further on my laptop.
      The next day I got the error mentioned above when requesting the site. (On the original and the copy)
      Any suggestions what I should do?
    • By BitPoet
      I'm a bit at a loss where to put my hooks. My requirement is to have a checkbox in the page (already there) that tells my module to pull fields (i.e. body, headline etc., but possibly others too in the near future) from the default language, no matter if there's a value set in the current language, and apply some replacement before rendering (think HannaCode-like, though with a whole dictionary database for technical terms behind it).
      Now, I'm unsure where to hook. I've looked through the LanguageSupport modules and tried to spy in HannaCode, but I've not been able to wrap my head around all the getLanguage..., getFormatted... and whatnot hookable methods involved. Attempts at overriding LanguageSupportFIelds::hookFieldtypeFormatValue and extending its logic somehow ended up with an endless recursion. If anybody could give me a few pointers (or method names) I should look for, this would be great.
  • Create New...