Jump to content

Repeater issue


Roberts R
 Share

Recommended Posts

After working with PW for quite so time i came to my first issue:

After testing around I added pages "part" with few fields and repeater.

$p = new Page();
$p->template = 'part';
$p->parent = '/parts/';
$p->name = $pageName;
$p->save();
$p->of(false);
....
// adding repeater
$store = $p->pStores->getNew();
$store->sCount = $sCount;
$store->sPartNr = $sName;
$store->sPrice = $sPrice;
$store->sStore = $pages->get(24464)->id;
$store->save();
$p->pStores->add($store);
$p->save();

added about 1600 items. Later on I deleted them Using 

foreach ($pages->get('/parts/')->children as $p){
        wire('pages')->delete($p);
}

Now i can't add any repeater items to new pages I create using code above. It gives me error

Can't save page 0: /1473421482-73-1/: It has no parent assigned

 

Now I try to delete repeater field and recreate it. But it says that

 Can't delete template 'repeater_pStores' because it is used by 1685 pages.

But there are no pages.

I looked in DB. and found that repeater fields still hold values for pages that does not exists.

[EDIT]: found that pages still exist in db. So i deleted them manually. Recreated field but same problem stands.

Im not sure in witch step I fcked up, but can someone point fingers at me and tell what i did wrong or why its not working?

 

 

 

Link to comment
Share on other sites

I did run deletePages and AddPages on same run. It was reason for my reapeater not saving for some reason.

deletePageChildren($pages->get('/parts/'));
addAPEPArts();

I can't figure why pages didn't get deleted from datebase. But I guess  that is story for another day.

Link to comment
Share on other sites

  • 10 months later...
  • 1 month later...

I have the same problem. I can confirm it is not really a bug but unwanted behavior @ryan.

It occurs, that when you delete pages and create ones (with the same name? in the same run, there is a problem with the correct page to be found. As the page still exists.

Is there a way to delete a page not after the entire page call is done? I supposed there is some smart mechanism to make only one SQL query, instead of synchronously deleting pages.

Thanks in advance.

Right now, I have to resort to two page calls.

  • Like 2
Link to comment
Share on other sites

  • 2 years later...

I have the same issue.
When I delete all pages (that have a repeater) from a parent and then add new pages (with repeater) to the same parent, then only one page is added and I get the same error:

"Can't save page 0: /xxxxxxxx-xx-x/: It has no parent assigned"

In the repeater_field in the DB there is no data, count=0 and a parent_id=0...

Is there any chance this gets resolved anytime soon?  (I guess not since this a thread of 2016 ? )

PS: If I delete the pages in a seperate call and add new pages in a second call, then the issue doesn't happen... 

Link to comment
Share on other sites

On 9/9/2016 at 3:13 PM, Roberts R said:

I did run deletePages and AddPages on same run. It was reason for my reapeater not saving for some reason.


deletePageChildren($pages->get('/parts/'));
addAPEPArts();

I can't figure why pages didn't get deleted from datebase. But I guess  that is story for another day.

What is the use of an API if you can not delete and then add in one run?  That is what I ask myself...

Link to comment
Share on other sites

1 minute ago, diogo said:

I didn't ask you to not post in the forum, you should feel free to do so. I asked you to not report your own posts to the moderators.

I did not report my own post, but the one of someone with the same issue from 2016.
My only goal is to get this resolved, but I don't use Github.
All issues got resolved via the forum until now.  I don't know why this issue is not.

Link to comment
Share on other sites

Ok, my bad. Still, reporting post serves a completely different purpose. Hopefully this will be picked up by someone that can address the issue, but the best is to post the issue on github. You would have to create an account there, and of course that's up to you, but you don't need to use git to do it, only fill a form on the site.

  • Like 4
Link to comment
Share on other sites

On 11/12/2019 at 4:38 PM, KarlvonKarton said:

All issues got resolved via the forum until now.  I don't know why this issue is not.

Maybe it has to do with that reported issues on github get more attention (at least from Ryan), and that issues on github are much better to handle in that workflow then in the forums here. The forums here are prior to support people with (maybe at first: "undefined issues" for them) that may be uncovered as wrong usage or something different. And sometimes it uncovers to be an issue in the core code base. Those one need to be filed at github to get recognition in the issue resolving workflow!

If you want to contribute to this project, you can file an issue at github into the issue repository, using the issue template there. A detailed explanation also is there to help everyone who is willing to participate in this community project.

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

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

×
×
  • Create New...