# Panel hook issues?

**URL:** <https://forum.getkirby.com/t/panel-hook-issues/2831>\
**Category:** Questions\
**Tags:** v2\
**Created:** [December 15, 2015, 4:09pm UTC](https://forum.getkirby.com/t/panel-hook-issues/2831 "2015-12-15T16:09:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![julieng](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/julieng/32/6770_2.png) [@julieng](https://forum.getkirby.com/u/julieng)\
**Post date:** [December 15, 2015, 4:09pm UTC](https://forum.getkirby.com/t/panel-hook-issues/2831/1 "2015-12-15T16:09:36Z")

</div>

Hi,

Is that me or some panels hooks have issues since the last update?

If I add to my `site/config/config.php` file:

```auto
kirby()->hook('panel.page.create', function($page) {
  f::write( kirby()->roots()->content() . '/test-create.txt' , $page->title() . "\n", true);
});
kirby()->hook('panel.page.update', function($page) {
  f::write( kirby()->roots()->content() . '/test-update.txt' , $page->title() . "\n", true);
});
kirby()->hook('panel.page.delete', function($page) {
  f::write( kirby()->roots()->content() . '/test-delete.txt' , $page->title() . "\n", true);
});
kirby()->hook('panel.page.sort', function($page) {
  f::write( kirby()->roots()->content() . '/test-sort.txt' , $page->title() . "\n", true);
});
kirby()->hook('panel.page.hide', function($page) {
  f::write( kirby()->roots()->content() . '/test-hide.txt' , $page->title() . "\n", true);
});
kirby()->hook('panel.page.move', function($page) {
  f::write( kirby()->roots()->content() . '/test-move.txt' , $page->title() . "\n", true);
});

```

_Create_, _delete_, _hide_ and _sort_ gives something not the other.  
Clue?

Thanks,  
j.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 15, 2015, 9:39pm UTC](https://forum.getkirby.com/t/panel-hook-issues/2831/2 "2015-12-15T21:39:10Z")

</div>

> [@julieng](#):
>
> Create, delete, hide and sort gives something not the other.

I’m afraid I don’t understand what exactly is the issue? Can you explain a bit more?

I tested it with a Kirby 2.2.3 install and seems to work as expected?

---

<div class="post-metadata">

**Author:** ![julieng](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/julieng/32/6770_2.png) [@julieng](https://forum.getkirby.com/u/julieng)\
**Post date:** [December 16, 2015, 10:25am UTC](https://forum.getkirby.com/t/panel-hook-issues/2831/3 "2015-12-16T10:25:26Z")

</div>

Thank you for your answer.

I will try to describe what I tested and what worked or not:

With the code above in my `site/config/config.php`.  
If I wrote it correctly, it should create a `test-*.txt` file in the content folder depending on actions from the panel.

My Process:

- when I create a new page in the panel, `test-create.txt` is writing: **OK**
- when I update content of a hidden page in the panel, `test-update.txt` is writing: **OK**
- when I update content of a visible page in the panel, `test-sort.txt` is writing, but not `test-update.txt`: **Not OK** , should not be just `panel.page.update` (or `panel.page.update` + `panel.page.sort` if you change content and position)?
- when I sort a page in the panel, `test-sort.txt` is write: OK
- and I don’t know what «`panel.page.move`» could mean from the panel, so I not able to test it.

Thank you for taking time to read my ugly english.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 16, 2015, 11:13am UTC](https://forum.getkirby.com/t/panel-hook-issues/2831/4 "2015-12-16T11:13:35Z")

</div>

> [@julieng](#):
>
> and I don’t know what «panel.page.move» could mean from the panel, so I not able to test it.

This triggers when you rename the page slug with the panel option “Change URL”.

> [@julieng](#):
>
> when I update content of a visible page in the panel, test-sort.txt is writing, but not test-update.txt: Not OK, should not be just panel.page.update (or panel.page.update + panel.page.sort if you change content and position)?

Yes, you are right. On updating, when the page is invisible, panel.page.update is triggered, when the page is visible, panel.page.sort is triggered instead of panel.page.update.

I have created an issue on GitHub: [Panel.page.update is not triggered when updating a visible page · Issue #701 · getkirby-v2/panel · GitHub](https://github.com/getkirby/panel/issues/701)

---

<div class="post-metadata">

**Author:** ![ivinteractive](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/ivinteractive/32/3472_2.png) [@ivinteractive](https://forum.getkirby.com/u/ivinteractive)\
**Post date:** [December 17, 2015, 5:57pm UTC](https://forum.getkirby.com/t/panel-hook-issues/2831/5 "2015-12-17T17:57:00Z")

</div>

Piggybacking on this, there also seems to be an issue with the ‘panel.file.upload’ and ‘panel.file.update’ hooks. When panel.file.update is set, panel.file.upload doesn’t get triggered.

In one plugin, for panel.file.upload, we would grab some data from an uploaded CSV/JSON, update the page, and delete the file. In another plugin, the panel.file.update hook would rename an updated file under certain circumstances. This caused the upload hook to not work. We tried bringing the update hook into the same file, and putting it both before and after the upload hook, and the upload hook only worked when the update hook was removed entirely.

Are the multiple hooks on files not intended to work sequentially like we’re trying to do? Or is there a cache somewhere that should be getting reset between those hooks getting triggered?

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:03pm UTC](https://forum.getkirby.com/t/panel-hook-issues/2831/6 "2025-02-06T17:03:54Z")

</div>


