Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by valan

  1. Gents, did you find source of this error? I get it from time to time and even can't understand how to debug it... Quite annoying...
  2. Ok. I think that smth like page-lister-find could be a solution.
  3. How to disable access to menu Pages>Find for the role?
  4. Aaa, ok - you are right re $page. Removed. PW 2.6.17 dev.
  5. Yes, this is strange. Looks like hook doesn't trigger... I've added wire()->log->error('Im here!'); at second line but it doesn't log anything. wire()->addHookBefore('Page::getMarkup', function($event) { wire()->log->error('Im here!'); $page = $event->object; $key = $event->arguments(0); if ($page->template != 'service') return; if ($key == 'MySpecialLabelKey') // service_exclude_cars { if($page->template == 'vehicle-make') $key = '{title}'; if($page->template == 'vehicle-modelGroup') $key = '{parent.title} > {title}'; if($page->template == 'vehicle-model') $key = '{parent.title} > {parent.title} > {title}'; } $event->arguments(0, $key); });
  6. I've copied code to admin.php and placed MySpecialLabelKey string to "Custom page label format" but it still doesn't work. Is "Custom page label format" the right place to insert the string?
  7. @LostKobrakai - no, it doesn't work for me as currently tags do not support conditions. I need different labels for different templates (or places in tree) - makes/models/modifications.
  8. I have a Page field that stores car pages from cars catalog. Each page is either Make or Model or Modification depending on its place in tree. Currently I use titles for page labels as seen at picture. The problem is that labels may have same title and its hard-to-impossible to understand car page location in tree structure by looking at field. E.g. I need labels that say where in tree structure car page is located, smth like this - for makes: {title} for models: {parent.title} > {title} for modifications: {parent.parent.title} > {parent.title} > {title} How to do that?
  9. I'm looking for filedtype&inputfield developer for my project. If you "can & interested in extra $$$ for few days of development & have time this/next week" - please send me personal message. Posting here few descriptions: $200: this one -> https://processwire.com/talk/topic/10539-how-to-render-runtime-markup-custom-php-snippet-in-page-edit-interface/ $500: time slot booking with dependent subfield (e.g. select time slot => get available user by ajax => select user) More detailed description => in personal messenger. Project is constantly developing, so quick help with job above => constant new job. Offer is valid till 4th of Sept. Edit: developed modules should be also freely available for PW community (you are author).
  10. The problem was in https://github.com/valieand/GoogleCidCatcher/blob/master/GoogleCidCatcher.module#L38 I've commented this 'permission' => array() line and module start to work!)
  11. Thank you! Will check and come back later with source of the issue - if not site-specific, it could be useful for other module devs.
  12. error.txt file says the same. So far I've commented this piece of code till I find way to enable debug for superuser only.
  13. @kongondo: - syntax is ok. I use it almost everywhere and it works w/o problems. E.g. wire()->pages, etc. Problem should be somewhere else. Could it be connected with autoload/singular module settings? Or use of __constructor()? I can't understand... - thanks for idea with custom config file for loggedin superuser. Is there any module for that? I'll experiment with it. I guess its a matter of setting $config->debug = true on each request, immediately after $config is initialized. But don't know which hook to use so far... - I don't use local/dev instance - its too time-consuming to keep things aligned/consistent in two systems.
  14. I'm doing my first steps as module developer and need some help. Here is my module https://github.com/valieand/GoogleCidCatcher This module adds hook after login which saves Google Customer ID from browser cookie to user page field 'user_google_cids'. It seem to work. But when I try to do the following somewhere in another place: $module = wire()->modules->get('GoogleCidCatcher'); I get Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /var/www/pw/wire/core/Selectors.php line 283) What is the reason and how to fix it? P.S. I can't enable debug mode as its a live site. Btw may be there exist another way to debug this error, less painful for live sites? Thanks.
  15. I'd like to create field that renders runtime markup (=custom PHP snippet) in page edit interface. E.g. smth like combination of FieldtypeConcat (for runtime calc) with Inputfield (that holds PHP snippet). My own attempts to do this failed so far.) Being new in module development I can't figure out how&where to save PHP snippet and how to load it... w/o damaging smth...) E.g. should I create table? or dbScheme? where field settings are saved? please help. Thanks! Pleae have a look at what I've coded so far: https://github.com/valieand/FieldtypeRuntimeMarkup
  16. @adrian - this is to confirm that now it works as expected. Thank you for this module!
  17. @adrian, ups, yes this is directed to you.) Replaced, but it does not fix a problem.( Particular setup: - module is installed with checked Hide "children, settings, delete" in settings - there is user X with role "content-editor". - when role "content-editor" has only "tab-settings-hide" and "tab-delete-hide" permissions - everything is OK, e.g. no any tabs in the page (btw children tab is also hidden) - when role "content-editor" has also "tab-children-hide" permission => error above Again, this happened in PW 2.6.10 dev - could be either result of permission system changes or simply dev bugs... Anyway, looks like this code may not setup $fieldset in some cases: if($tab == "Settings" || $tab == "Children") { $fieldset = $form->find("id=ProcessPageEdit".$tab)->first(); } else { $fieldset = $form->find("id=ProcessPageEdit".$tab); } P.S. The same error is thrown in another scenario - when editing "user" page by different user/role. But now issue is with "tab-settings-hide" only... P.S. Just idea - may be some tabs in some cases can't be found with $form->find? E.g. for example when user does not have access to add children (restricted at template level) then Children tab is not displayed. EDIT: Temporarily made quickfix after if-else block above: if (!is_object($fieldset)) return; It prevents errors - module works as expected at all pages. Except "user" page - here "delete" tab does not disappear (while "tab-delete-hide is ON"), but "children" tab disappears ("tab-children-hide" is ON too).
  18. @arjen: FYI and possible fix - since upgrade to PW 2.6.10 in some cases module throws error "Call to a member function attr() on a non-object (line 245 of /var/www/pw/wire/core/InputfieldWrapper.php)". Playing with settings I've mentioned that it happens when I check tab-children-hide for user that gets this error. There were major permission system updates in PW 2.6.10 so I guess new core may conflict with module somehow. EDIT: Continued experiments and found that tab-settings-hide causes this error when trying to edit user page. Also tab-delete-hide does not function at user page. E.g. clearly there are some conflicts btw PW 2.6.10 and this module.
  19. @Macrura: thanks! What if you need to place markup somewhere on the page (e.g. btw some fields)?
  20. Q: see topic title As far as I understand there should be at least two ways: - kind of locked Textarea/CKEdit field that is filled with markup being generated from PHP snippet when page is opened in edit mode - some kind of hook that injects markup into the edited page in right place I've checked available modules but haven't found the answer. If this kind of Q has been addressed somewhere before, I would be glad to hear about it!
  21. @Ryan: wire()->fields does not return id, name, path, url, template Fields. I think these "system" fields should be checked separately. See also https://github.com/ryancramerdesign/FieldtypeConcat/issues/6 So far I've added the following piece of code that works. $sys_fields = ['id', 'name', 'path', 'url', 'template']; foreach($sys_fields as $fname) { if(strpos($str, $fname) === false) continue; $s = $str . ' '; while(preg_match('/\b(' . $fname . '(\.[-_.a-zA-Z0-9]+)?)\b(!?)/', $s, $matches)) { $fieldName = $matches[1] . $matches[3]; $lengths[$fieldName] = strlen($fieldName); $s = str_replace($fieldName, str_repeat('#', strlen($fieldName)), $s); if(strpos($s, $fname) === false) break; } }
  22. @adrian: thanks, now works perfectly!
  23. Does module differ superuser from non-superuser? When I hide Children, Settings and Delete tabs, they become hidden for all non-superusers (as expected). As for superuser - Children and Settings also become hidden, and Delete remains visible. I'd like superuser not be affected, e.g. all tabs should be visible. Is it a bug or feature? PW 2.6.4
  24. How to make "After save" fieldset visible only for superusers? Being a superuser I like to work with "After save", but other roles have destructive access to system through it... Thanks!
  25. I've installed http://modules.processwire.com/modules/process-dashboard/ and redirected some custom role to this page after login. ... after that browser freezes in endless "waiting" mode when user (with that custom role) attempts to login. Any ideas why this happens? P.S. PW 2.6.4 Edit: two bugs discovered (1) infinite redirects caused by process-dashboard. Had no time yet to understand why... (2) hidePageTree redirects only to /admin/smth while smth could be in /admin/somefolder/smth
  • Create New...