Jump to content

Clarity

Members
  • Posts

    125
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Clarity

  1. 15 hours ago, horst said:

    Maybe something like this can work?

            if(!$this->wire->input->get->id) return;
            $editedPage = $this->wire->pages->get('id=' . $this->wire->input->get->id);

    But, if it is to early in the process, the page doesn't have an ID, So I'm not positive if it is right to hook into processing the initial form, or if it would be better to hook into before displaying the editpage with the error message labels? (And do another redirect after correcting the missing values).

    Actually, the page which is not yet created actually has ID = 0, but the path for adding the page is /page/add/ and it doesn't have ID of this page as GET parameter.

    13 hours ago, MarkE said:

    You should be able to to that with $event->object->getPage()

    Quite whether this is the right place to hook, however, is another matter...

    Thank you, it seems to be right! I shall explore what I can do with this page in more details and report here about the results.

    • Like 2
  2. The error is "Missing required value" on title and name. It is not in error stack, it's just a specific error which follows from requirement of title and name. I want to resolve it by filling transliterated title and name on other languages. However, I don't know the name of the function in which I should hook in order to edit the title well before actual save(). When I hook immediately before save() and try to bd() inside this hook, bd() doesn't work.

  3. 7 hours ago, Ksenia said:

    Hello, Clarity! 

    I am not sure I understand your comment also given the bug that I see after using suggested:

    var_dump($matches->getSelectors());

    Is it something to do with me sanitising the array items as IDs?

    Best,

    Ksenia 

    But also thanks a lot for this line, now I at least know what to debug. :--)

    Hello, Ksenia!

    On a bit unrelated note, you can use Tracy Debugger instead of vanilla `var_dump`. You can output the variables to the debugger using `bd()` function like that: `bd($matches->getSelectors())`.

    • Like 2
  4. Hello, @Ksenia!

    I think it happens because IDs of pages are 1652 and 1674, and `$item` variable converts to ID. When you iterate over pages, you get `$item` to be 1652, 1652 and 1674, which composes into 1652|1652|1674| and then truncates into 1652|1652|1674 when you assign `$final_output` to it. That's why your condition is true and you have "I don't get it!!!" string.

    For example, if you write on homepage template file `echo $page`, it will output 1 because 1 is the ID of the homepage.

    • Like 1
  5. Hello, @ukyo!

    Current variant of Mystique in "master" branch gives the error "You need to select a resource and save field before start to use Mystique." after creation of the page. I don't see that it is possible to select a resource just after creation of the field. Switching to the branch "next" solves the problem.

    In addition, Mystique will search files in form Mystique.*.php in site/templates/configs, not in site/templates.

  6. I need that because my admin action copies content of fields from one language to another, and we should somehow warn user that languages are identical (since I think it doesn't make sense to copy the content to the same field). I've thought that not allowing to pick language in "destination" fields might solve the root problem, but I already solved my problem using PHP. Just added the warning that languages were identical after successful execution of Admin Action.

    • Like 2
×
×
  • Create New...