kixe

Members
  • Content count

    656
  • Joined

  • Last visited

  • Days Won

    5

kixe last won the day on February 12

kixe had the most liked content!

Community Reputation

924 Excellent

About kixe

  • Rank
    Hero Member

Contact Methods

  • Website URL
    http://qualyweb.com

Profile Information

  • Gender
    Male
  • Location
    Cologne, Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Namespace problem. Somewhere in your files (ready.php?) the namespace ProcessWire is defined. You need to remove this. Don't mix files of installations (PW 3.0.x) using namespace with non namespace installations (PW 2.7 or 2.8)
  2. I tested my code and it works. Maybe there is a namespace issue. Which PW Version do you use? Did you place the code in the right file and folder?
  3. kixe

    Enable debug mode to get the error messages and figure out the problem. in /site/config.php $config->debug = true;
  4. @PWaddict Thanks https://github.com/processwire/processwire/commit/79fa81d8a87a1d026d8f763021b8df191f48a4e0
  5. kixe

    If you need this for the backend (result available in frontend too) you can use FieldtypeMarkup for the result. Grab the code from here: https://github.com/kixe/FieldtypeMarkup Create a hook with your formula and place the code in /site/ready.php The result will be populated after saving the page. /** * https://github.com/kixe/FieldtypeMarkup * FieldypeMarkup as concat field with formula * EXAMPLE * */ $wire->addHookAfter('FieldtypeMarkup::formatValue', function($e) { $page = $e->arguments[0]; $field = $e->arguments[1]; // quick exit if ($field->name != 'result') return; if ($page->template != 'calculator') return; $value1 = $page->inputfield1; $value2 = $page->inputfield2; $value3 = $page->inputfield3; $value4 = $pages->get(12345)->inputfield1; // get value from another page $result = $value3 * ($value2 - $value3) / $value4; // formula $e->return = $result; });
  6. kixe

    Set up a page which just return the cookie banner, put it in an iframe and add it to the other sites. You would have to change (loosen) the x-frame options in your .htaccess file of the framed page to get this work. All-in-all not the best solution.
  7. kixe

    It looks like PW is searching for PHP\CustomHooksForVariations, but this class doesn't exists. Namespace settings ok?
  8. @Fuzzy Place this code in /site/ready.php Create this file if it doesn't exist.
  9. kixe

    @Pete This thread should be appended to the support thread of ProcessSetupPageName https://processwire.com/talk/topic/8576-name-format-children/ @pppws Which PHP version doesn't work? which one works? Which module version do you use? Which ProcessWire Version?
  10. You can change the module service url in your config.php file. $config->moduleServiceURL = 'http://modules.processwire.com/export-json/'; $config->moduleServiceKey = (__NAMESPACE__ ? 'pw300' : 'pw280'); Format of the complete url: {moduleServiceURL}/{moduleClassName}/?apikey={moduleServiceKey} Example: http://modules.processwire.com/export-json/MarkupCookieConsent/?apikey=pw300 If you provide this service (json format) for your module by your own you could hook in ProcessModule::execute if ($input->get->update) { $this->addHookBefore('ProcessModule::execute', function($e) { $moduleClassName = $this->wire('sanitizer')->name($this->wire('input')->get->update); if ($moduleClassName != 'MySuperPrivateModule') return; // change service url here $this->wire('config')->moduleServiceURL = 'http://example.com/export-json/'; }); } Another solution: Symlink your module if all sites using this module are hosted on the same server.
  11. kixe

    For security reasons, a cookie can not be set for a different domain. There may be ways to trigger this, but this could open security holes. The cookie set by this module also applies to subdomains.
  12. @wbmnfktr The reason is the invalid token: https://github.com/processwire/processwire/blob/bdaf8810cbb71944820c45e0b297d0b75f1e60be/wire/core/SessionCSRF.php#L176-L191 Make sure that the session cookie is set and valid and that the current valid token is sent with the form.
  13. All forms in the backend of processwire are secured against CSRF attacks by assigning them a one-time token. This will ensure that the page and the current session that generates the form is the same as the one that receives the form. E. g. The error message appears when a backend page (also Login) is open and the session has expired, or the session cookie has been deleted from the browser or could not be set in the browser.
  14. Try this hook in hook $this->addHookBefore('PageRender::renderPage', function($e) { $event = $e->arguments[0]; $page = $event->object; $user = $this->wire('user'); // QUICK EXIT if ($user->isSuperuser()) return; // superuser if (!empty($page->template) && $page->template->id == 2) return; // backend if ($user->language->isDefault()) return; // default language $language = $user->language; $currentLanguageStatus = $page->get("status$language"); if ($currentLanguageStatus == 0) { $otherPage = $this->wire('pages')->get(1234); // get page to be rendered instead $event = new HookEvent(array('object' => $otherPage)); $e->arguments(0, $event); } });
  15. 1. Use the right sanitizer $email = $sanitizer->email($email); $pagename = $sanitizer->pageName($pagename); // OR $pagename = $sanitizer->pageNameUTF8($pagename); 2. Set adjustName to true in the save options array to make your page name unique $np = new Page() // ... $np->save(array('adjustName' => true));