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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By David Karich
      ProcessWire InputfieldRepeaterMatrixDuplicate
      Thanks to the great ProModule "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use a content module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      This module extends the commercial ProModule "RepeaterMatrix" by the function to duplicate repeater items from one page to another page. The condition is that the target field is the same matrix field from which the item is duplicated. This module is currently understood as proof of concept. There are a few limitations that need to be considered. The intention of the module is that this functionality is integrated into the core of RepeaterMatrix and does not require an extra module.
      Check out the screencast
      What the module can do
      Duplicate a repeater item from one page to another No matter how complex the item is Full support for file and image fields Multilingual support Support of Min and Max settings Live synchronization of clipboard between multiple browser tabs. Copy an item and simply switch the browser tab to the target page and you will immediately see the past button Support of multiple RepeaterMatrix fields on one page Configurable which roles and fields are excluded Duplicated items are automatically pasted to the end of the target field and set to hidden status so that changes are not directly published Automatic clipboard update when other items are picked Automatically removes old clipboard data if it is not pasted within 6 hours Delete clipboard itself by clicking the selected item again Benefit: unbelievably fast workflow and content replication What the module can't do
      Before an item can be duplicated in its current version, the source page must be saved. This means that if you make changes to an item and copy this, the old saved state will be duplicated Dynamic loading is currently not possible. Means no AJAX. When pasting, the target page is saved completely No support for nested repeater items. Currently only first level items can be duplicated. Means a repeater field in a repeater field cannot be duplicated. Workaround: simply duplicate the parent item Dynamic reloading and adding of repeater items cannot be registered. Several interfaces and events from the core are missing. The initialization occurs only once after the page load event Changelog
      1.0.4
      Bug fix: Various bug fixes and improvements in live synchronization Bug fix: Items are no longer inserted when the normal save button is clicked. Only when the past button is explicitly clicked Feature: Support of multiple repeater fields in one page Feature: Support of repeater Min/Max settings Feature: Configurable roles and fields Enhancement: Improved clipboard management Enhancement: Documentation improvement Enhancement: Corrected few typos #1 1.0.3
      Feature: Live synchronization Enhancement: Load the module only in the backend Enhancement: Documentation improvement 1.0.2
      Bug fix: Various bug fixes and improvements in JS functions Enhancement: Documentation improvement Enhancement: Corrected few typos 1.0.1
      Bug fix: Various bug fixes and improvements in the duplication process 1.0.0
      Initial release Support this module
      If this module is useful for you, I am very thankful for your small donation: Donate 5,- Euro (via PayPal – or an amount of your choice. Thank you!)
      Download this module
      > Github: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate
      > PW module directory: https://modules.processwire.com/modules/inputfield-repeater-matrix-duplicate/
    • By gerritvanaaken
      Wouldn’t it be cool to have whole repeater items (or even repeater matrix items) language-specific. Some of my clients do have pages that are 90% identical in German and English, but there are some sections that should not appear in one or another language. I attached a concept screenshot.
      Would something like this be possible with some simple backend hooks and "hidden checkbox fields"? Or is it way more complicated?
       

    • By brdje
      Greetings,
       
      I've ran into an issue with adding a repeater field to a template.
      The page editor in the backend shows the fields and the data attached to the fields, including the repeater.
       
       
      However, when viewing the template in the front-end, there is no sign of a repeater field in the data set.
      ["data"]=> array(3) { ["name1189"]=> string(11) "partenaires" ["status1189"]=> string(1) "1" ["title"]=> string(8) "Partners" } } Do u have any idea what could be causing this issue?
      I've tried recreating the field and there is no caching active, but still can't get the repeater in the data set.
    • By DooM
      Hello guys,
      I'm trying to figure out how to sync fields and templates between staging and production environments.
      I've found Migrations module by Lostkobrakai, but with use of it all the fields and templates must be created by API, which is kind of uncomfortable.
      I also tried ProcessDatabaseBackups module which can export only certain tables, but I don't think it's the best practice to do that.
      How do you guys solve this problem? It's very annoying to setup everything three times (dev, staging, production).
      Thanks a lot :)
    • By Robin S
      Repeater Images
      Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc.
      When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing.
      Screencast

      Installation
      Install the Repeater Images module.
      Setup
      Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration
      Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module.
      Image uploads feature
      There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field.
      To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position.
      It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field.
      New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved.
      Tips
      The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height})  
      https://github.com/Toutouwai/RepeaterImages
      https://modules.processwire.com/modules/repeater-images/
×
×
  • Create New...