Jump to content

cehlo

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

3 Neutral

About cehlo

  • Rank
    Jr. Member

Recent Profile Visitors

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

  1. Hi there, If I understand correctly you don't want to have selected none page? If that is the case, just drop down pages for select, find that one which is selected and choose "unselect".
  2. Hi guys, I am just thinking about purchasing Form Builder. First, I want to ask if it is possible to generate forms also on backend custom pages, because in description of module is written only about generation forms in frontend? You would ask why would I want to use forms in backend. There are some events, which I want to create online registration for - different for members - they will log in and It will automatically load information from their accounts to forms, on the other hand there will be different form for users which do not have accounts on frontend. Thank you for your assistance. Cheers Cehlo
  3. Thank you, that save my day :).
  4. Hi guys, just one shor question maybe just for my insight. When we are using PageArray like array of pages, it is possible to have same page in there twice? Specific problem - I had created method to generate pedigree of dog with 30 ancestors. It is PageArray and order of pages / dogs is important here to generate fronted output. So, You know dogs are not very monogamic and inside one pedigree it is possible that one male ancestor is there multiple times. So problem is that during generation of this PageArray, when there is second occurence of same page / ancestor, first will disapper. So my question is - is not possible to have same page multiple times in Page Array or should I look for some errors in my code (which I did not find for now) ? <?php // It is not same code, but this is all according to manipulation with pageArray I am using when I am creating PageArray $pedigree = new PageArray(); $pedigree->add($ancestor_page); ?> Thank you for your answers. Cheers B.
  5. Hi there, I do not know where the problem is, but the notice is not showing when users are logout. It is showing only when logged in as superuser (on frontend, or module configuration page). Any Ideas what could be the problem? Also I tried to reinstall module, refrech cache, clear local storage. Still I tried it on various devices, cookie notice is nowhere to be found. Thank you very much.
  6. Hi folks, do you have some ideas to my problem? I can´t really find the solution. When I am editing any page with different role than admin the top processwire menu disappears. Only happens while editing. See photo. Thank you very much for any help. Cheers.
  7. Hi folks, I am reaching you one more time for help with error I can´t solve. The setup is little more complicated, but I will try to introduce it in the best way. I have multiple user roles, one of them is role "member". These members have certain pages that they can edit, permission is granted during some automated process ( request for permission to edit, check if it is authorized, grant permission - via custom modules and hooks) but permission for editing is saved via module "PageEditPerUser". This pages which "member" can edit, have PageReference field, which is pointing on that user (Access - Users - Page of user) - field is called "dog_ownerSelect" and is used for loading personal data of owner = authorized user to page. Problem appears when the member is logged into processwire and he want to see pages which he can edit on live site. Return is only some error which does not seem have sense. On site traditionally error 500, because it is not superuser - output from tracydebugger error log is: [2019-11-03 10-30-56] PHP Notice: Undefined property: ProcessWire\User::$language in /nfsmnt/hosting1_1/b/5/b5ca8bf7-6179-408f-b688-09da79c8a644/daisy.sk/sub/hovawart/wire/core/PagesLoaderCache.php:236 @ https://hovawart.daisy.sk/databaza-chovu/chov/dajana-z-posonia/ When I added TracyDebugger permission to member, result: Call to a member function isDefault() on null. I am using $language in multiple places but that doesn't seem to be problem. I traced the error in file to using variable "dog_ownerSelect" in any way. <?php if(!$page->dog_ownerSelect){ } else { } ?> If there is this variable (which is pointing to user who is logged in) in any place in the file, it throws error I described. But this error occurs only if the user with role member is trying to look the page which he can edit. When you try to load page with guest or superuser or other member which doesn't have right to edit this page everything is going 100% smooth. Thank you for any suggestion where the error might be. Cheers Cehlo
  8. Thank you all. WillyC hit it. That was my one little mistake 🙂
  9. Hello, i just hit another problem. Maybe is very easy, but I can not find the place where I am having error. So I am doing some admin custom page - it shows requests from users for administrator. Administrator checks request and then should hit button approve or delete request. I am done this by creating table, and for each row in template I want to add also link with some data for GET. Problem is that table for some reason does not encode/render the link proper way - it only output html markup. (image 1, 2). Maybe I am missing something important? My relevant part of code below: <?php class ProcessRequests extends Process { public function init() { parent::init(); // required } public function ___execute() { $requests = new WireArray(); $match = $this->pages->find("template=request"); $requests->import($match); $requests->unique(); $requests->sort("-created"); $count = count($requests); if ($count) { $url = $this->config->urls->admin . 'page/edit/?id='; $table = $this->modules->get('MarkupAdminDataTable'); $table->setSortable(true); $table->setEncodeEntities(true); $table->headerRow(array( $this->_('#'), $this->_('Názov žiadosti'), $this->_('Typ žiadosti'), $this->_('Týka sa psa'), $this->_('Žiadosť podal'), $this->_('Vytvorená'), $this->_('Akcia'), )); foreach ($requests as $key => $u) { $mailer = $this->pages->get($u->request_mailer_id); $dog_ref = $this->pages->get($u->request_dog_reference->id); $table->row(array( $count - $key, $u->title => $url . $u->id, $u->request_type->title, $dog_ref->title => $url . $dog_ref->id, $mailer->name, date('Y.m.d - H:i', $u->created), "<a href=''>Schváliť</a>", )); } $out .= $table->render(); } else { $out .= "<p>" . $this->_("Well done, all dogs are edited.") . "</p>"; } return $out; } } Thanks for any replies :).
  10. The solution with module suggested by Adrian works perfectly, no more headaches. My problem was that the field dog-father and dog mother are fields Page Autocomplete, but with query selector, for dog_mother -> show only pages of template where dog_sex = female and for dog_father ->show only pages of template where dog_sex = male. So when I create new page via Autocomplete by hitting enter, it does not populate created page in field because, created page have no dog_sex setting saved, only title when doing it this way. Now I create all page in modal, dog_sex is required field so, problem solved.
  11. Yes, you understand perfectly 🙂 Thank you very much, you spare me from a long headache 😄 But in all cases how would be the correct way to return created page id with that hook? Is it even possible?
  12. Yes exactly, I want to create page with default title, but at same time populate value to one field in created page in relation with Page Reference field in which was new page created. My assumption is that I need to return value of page id created with this function ___processInputAddPages($input) /if that is possible/ and than add to created page desired value in relation with Page reference field. $wire->addHookAfter('InputfieldPage::processInputAddPages', function($event) { // Retrieve added page id - this is the hard part, I don't know how to do this // And than populate values to another field $field = $event->object; if($field->name == "dog_father"){ $page = $pages->get(???); //need for ID of created page $page->setAndSave('dog_sex', 1); } else if($field->name == "dog_mother"){ $page = $pages->get(???); //need for ID of created page $page->setAndSave('dog_sex', 2); } }); Or I am coming totally wrong on this? 😄
  13. Hello everyone, I am starting to creating some hooks, but I am little bit new to this part of Processwire so please help 🙂. My problem: I have multiple fields in one template - Page Reference - I activated autocomplete and also possibility of creating new pages from the fields. Is it possible to add additional values to newly created page via Page Reference field? For example: I know that the name of Page reference field is called for example car - I am searching with autocomplete for example for Mercedez, it is not created, so I know that newly created page via this field will have value in category field - cars,... I think I should addHookbefore to InputfieldPage::processInputAddPages, am I on the right track? Any assumptions? Thanks for help.
  14. OK, I finally get it working. I must admit that I don't know where the problem was. Solution with Page::listable, does not seem to work. I was using also Tracy debugger, bardump - return what I expected, but nothing changes on page. So I was doing little testing and searching and I come with this, which seems to work. 🙂 <?php namespace ProcessWire; $wire->addHookAfter('ProcessPageList::find', function(HookEvent $event) { if($this->user->isSuperuser()) return; $pages = $event->return; if($this->config->ajax){ foreach($pages as $p) { if($p->template == 'test') $pages->remove($p); } $event->return = $pages; } });
  15. Hmm. Error dissapered but I can't get it working, my template names are OK, but nothing changes. Some idea?,
×
×
  • Create New...