The problem is when I run this I get 100% of the articles as drafts. I cannot set the num prop as this tells me that the page cannot be sorted (due to the definition in the blueprint).
The documentation here tells me the isDraft prop sets the draft flag.
I know I could do this differently by randomly publishing the page after creation, I just want to know why this way doesn’t do what I think it should do.
You can’t set it to a date as it throws an exception due to the blueprint having a custom value for num. I set it to null because that was in the link you posted as a solution.
Just to point out the issue specifically (assuming I’m understanding everything correctly) @SeriousKen was calling Page::create() with an array setting 'isDraft' => $faker->boolean(10), but the field should have been 'draft' => $faker->boolean(10).
That is, Page::create() expects the field indicating the draft status of the page to be called draft, not isDraft.
Well, the prop must be called draft instead of isDraft, yes, but if you want to have a listed page, you also need to set the num prop to a valid value for your numbering scheme defined in the blueprint. Otherwise, the page will not be a draft anymore, but still unlisted.
The documentation for Page::create does not list draft as a prop, but isDraft and setting num to any value other than null give me the following exception:
This is due to the blueprint setting a custom num. If I have a blueprint without the custom num then it works, but the numbering is not the date, even if I set the num prop to a date.
I tested with the setting from your blueprint above and my last code example and Kirby 3.9.0. If that doesn’t work for you, then so be it and feel free to create an issue on GitHub. Just trying to help.
Did you try creating multiple pages like my code does? I noticed it actually fails after the first when setting num to a date. I’ll raise an issue on github.