Jump to content

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?

 

 

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

I just hit this same issue as well.

My resolution was to break up my script into two separate files (first one deletes a bunch of pages, second one adds a bunch).

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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... 

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

I even tried to delete 1 page (which has a repeater) with the API and add a new page (which has a repeater) in 1 run...  It doesn't work...

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By ICF Church
      Hi 👋
      Anyone else having this problem?
      Requirements:
      - Repeater (matrix & normal) with mutlilanguage fields (text, textarea…) 
      - Backend language set to something other than default (ie. German) 
      Reproduce:
      - Add a new repeater Item (ajax, I found no way to possible to disable it with matrix)

      (Notice how the default language tab is active instead of the backend language…)
      - Write something into the (default language) field
      - Try to save, if field is required, this will not work. If not required, then when reloading, the content will be inside the backend language field, instead of the default language field who was (presumably) active
      Analysis:
      When  loading  a new repeater element with ajax, the default langue tab is active, but the backend language inputfield is visible (with no visual indication). When writing into the field, it will populate the backend language. When manually clicking on the default language tab (which is already active), the field will switch to the actual default language field (which is [now] empty) (that can now be populated…)
      Also Notice, the labels of the elements to be added are in default language as well instead of the translated label (images instead of Bilder)…
      ProcessWire 3.0.148, Profields 0.0.5…
      Is it my system configuration, or does anyone else have the same issue? This is a screen recording of the problem:
      Issue: https://github.com/processwire/processwire-issues/issues/1179

      Screen Recording 2020-02-25 at 14.18.31.mov
    • By neonwired
      I have a front end form for creating new pages, repeater and repeater matrix field don't seem to save any data. I was considering handling the data manually but can't seem to get anything useful from the post data, are there any methods i can use?
    • By neophron
      Hi,
      I'm having trouble with a maybe simple code:
      I created a repeater (gallery_logos_links) and a repeater matrix (RepeaterMatrix_unternehmen). The repeater (gallery_logos_links) is inside the matrix repeater as a matrix type.
      The repeater matrix type is: gallery_logos_links and the image filed from the repeater is single_image.
       
      This my code:
      <?php foreach ($page->RepeaterMatrix_unternehmen as $item) { if ($item->type == 'gallery_logos_links') { echo " {foreach($item->repeater_logos_links as $logo)} <img src='{$logo->single_image->url}' alt='{$logo->single_image->description}' width='400'> {endforeach} "; } else if ($item->type == 'some_stuff') { echo"  
       
    • By shadowkyogre
      [EDIT]: After sitting down and planning out my site according to the ragged hierarchy information, I settled on the following schematics.
      /$world/$template/$content_of_template_type/... for my pretty URLs /roster/$character for my characters a generic Repeater field with depth on most content types for custom positions for child pages to connect to instead of it directly a few Repeater fields on each content that have (PageReference[1], other fields) to establish associations A few FieldsetGroups to help me manage the fields that I needed to copy across a bunch of content types. Kept the original post below for context and tagged the OP for searchability.
      ---
      Hi everyone! I'm working on a personalized worldbuilding wiki to host my art and story stuff.
      Right now my site architecture looks like...
      /$world/cosmology/$cosmology /$world/locations/$location /$world/factions/$faction /$world/history/$history /$world/species/$species /roster/$character So far the layout works, but there's one problem. I need to make sub-sections for an organization. Organizations can appear under cosmology, locations, and factions. Sounds straightforward until... I run into the problem of figuring out how to represent subfactions.
      Key factors in this are...
      Characters should be able to be part of multiple organizations Characters should have an explicit role assigned to their membership. Character pages should be able to query the organization pages to display their ranks across organizations. Editing an organization's hierarchical layout should be visible while editing the root organization page. From what I've read of the ProcessWire documentation, the best use case for each way of representing the organization's subsections are...
      Child Pages:: Works best for menu presentation and dedicated editing. PageTables:: Works if you want control over where to place the PageTable fields, but requires opening a modal for the pages you want to edit. It's also kind of like normal pages. Repeaters:: Works great for inline editing and easy control over hierarchy, but the page urls become obscure. Sections in the body field:: Works for copypasting from my note files. But it doesn't expose relationships for easy querying. It looks like my best case for this is child pages since it allows displaying suborganization in the URL easily. But also I lose out on quickly reordering and editing the child pages. Any advice for people running into similar use cases?
    • By EyeDentify
      Hello Dear PW Gurus.

      Hope you fair well in these Corona Crisis times.

      Anyhow, i have a problem with a Cryptic error message that shows up when i am trying to Delete images out of a Images field.
      The Error message does say a little but it does not make sense to me why i can´t delete the images because of it.

      Is it some permission issue perhaps?

      I will attach screenshots of it and what i did prior to it.
      I am from sweden so ignore the funny words here and there.

      Hope you all can send me on the right track.
      i am running PW 3.0.139 on this install.

      Step1:

      Step 2: Select the images with the trashcan symbol

       
      Step 3: Cryptic Error message

      I am scratching my head on this one, have not seen this before.

      Thankfull for all help.
      /EyeDentify
×
×
  • Create New...