Jump to content

new page via API name error


joe_g
 Share

Recommended Posts

Hello,

this works:

$user->language = wire("languages")->get("default");
$p = new Page();
$p->parent = $pages->get('/things');
$p->template = $templates->get('mytemplate');
$p->title = 'blablabla';
$p->save();
 
..but this doesn't (in pw2.4):
$user->language = wire("languages")->get("english");
$p = new Page();
$p->parent = $pages->get('/things');
$p->template = $templates->get('mytemplate');
$p->title = 'blablabla';
$p->save();

i get

Can't save page 0: /en/things/: It has an empty 'name' field

any ideas how to get around this?

J

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...