$newuri = 'hello-'.time();
$data = ['title'=>$newuri, 'text'=>'hello'];
$new = site()->pages()->create($newuri, 'default', $data);
echo '['.$new->text()->value().']'; // empty? Κγβ’α΄₯β’Κγ οΈ΅ β»ββ»
// probably a hook or other plugin kicked in. lets fix that.
$new->reset(); // (ΰΉβ’Μγ β’Μ)Ωβ§
// if you need page models right now you will have to follow these instructions
// https://forum.getkirby.com/t/call-page-model-in-panel-field/7179/2
echo '{'.$new->text()->value().'}'; // now it works
I canβt reproduce this. For me, each echo returns something without the reset. Are you using any plugins? I had a similar problem in the past where the Modules plugin was causing a similar problem.
yes i have a lot of plugins and some hooks. but i am not using the modules plugin.
it works without reset() on clean install like you said.
i could not quickly find responsible plugin/hook.
page models are not loaded either. needed to get them back myself (see above). but this time i am not even creating pages from the panel. it fails in frontend.
maybe someone from kirby team could check the return value of the page create function with page-models, hooks and plugins in mind.
the link i added in the code above refers to getting page model in hooks or panel. and yes β i am creating a page in frontend but i comes back without the page-model anyway. so i had to get it myself.