AutoID Plugin (create unique page ids)

@helllicht I would like to know that too :slight_smile:

hi @Ti_Gr I continued this topic in the question categorie.
Short answer: ->findBy('$field', $value())

The longer version: you can find here Get the page object from a given field value

good luck!

1 Like

Thank you @TakioTk for your reply. works great :slight_smile:

anybody looking to speed up autoid? here is how…

https://github.com/helllicht/kirby-autoid/issues/7

3 Likes

Anyone had the same problem as me on Kirby 2.5.9? The AutoId field doesn’t get a value. I have filed a github issue for it, but wondered if it was just me.

I have old pages where the AutoID seems to have to stuck, but ive just created some new ones since upgrading to 2.5.9 and the ID field is blank after saving.

I tried reproducing this with a fresh installation of the 2.5.9 starterkit. It works for me just fine. Have you verified that you have installed the plugin correctly?

@lukasbestle Intresting. Thanks for trying, yes plugin has been working up until now (sites about a year old). The only thing thats changed is that i recently updated to 2.5.9.

Edit: I just rolled back to 2.5.8, and it works. I’m running this on Laravel Valet on High Sierra (PHP 7).

@lukasbestle the odd thing is, that I just setup the starterkit for 2.5.9 and installed autoid and it worked fine. How odd.

I reinstalled 2.5.9 and autoid (exact same version but replaced anyway) and now it works on the website i had the issue on.

Could the issue with sorting more then 10 articles that was fixed in the toolkit lately be the cause? I manually edited the single line of code as you suggested in the Github issue. Now i’m running a Kirby that does not have this fix. Im guessing autoid looks for all the articles and sorts them to work out what the next ID number should be, so it seems logical to me this might be linked.

Yes, that might be the issue. That’s probably why I couldn’t reproduce it in my test installation as that’s actually on the develop branch. :sweat_smile:

2.5.10 with the sorting fix will be out (very) soon!

1 Like

@lukasbestle Oh dear. Just upgraded to 2.5.10, and the issue with AutoID persists :frowning:

Hm, but didn‘t you say that it works with the starterkit? Maybe there‘s something special about your site. To debug this, I need further information.

it works with 2.5.9 startkit & my site without the manually added sorting fix as per github

It does not work in 2.5.9 with that fix applied, nor does it work in 2.5.10.

If i roll back to 2.5.8, everythings peachy :slight_smile:

If i create a page with the patched 2.5.9 or 2.5.10, the autoid field does not get a value. If i roll back to official 2.5.9 or 2.5.8, and then go back in and save the same page, hey presto it gets a value. The site has 20 or so pages in it. i dont know if it works on a site with pages under the limit that seems to trigger the bug.

I repeated this two or three times, and it happens everytime. I hope that helps.

We needed to change something in 2.5.10 shortly after the initial release this morning. Could you please download 2.5.10 again to make sure that you have the correct version?

@lukasbestle Whoop! good job! Downloaded fresh copy and now all is well. AutoID working again. :dizzy: