vmo

two different repeaters cloning repeater fields

Recommended Posts

Hi,

I am creating a template that have two repeater fields:

- One for "slideshows" images, other for "highlights" images

The field "slideshows" has a "slideshow_images" field (image type) to be repeated

and the fields "highlights" should have the field "highlights_images" field (image type) to be repeated.

What is happening is when I add the the "slideshow_images" to the field "slideshows" the field "slideshow_images" is also added to the field "highlights"

and if I had the field "highlights_images" to the "highlights" field the "slideshow_images" in the field "slideshows" is replaced by the "highlights_images" field.

 

I already deleted all fields and create from scratch and the result is always the same.

I am using the Processwire 3.0.39.

 

Can anyone explain what is happening?

Thank you

Share this post


Link to post
Share on other sites

Hi,

I found the problem.

After uninstall the module "AutoExportTemplatesAndFields"  the problem was solved the repeater fields now have different fields

and when I change the field in one does not affect the other repeater fields.

 

Thank you.

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 burning
      Hi All, maybe a really stupid question, but is there a way to sort repeater items on -created?
      Like $page->social_activity('limit=10,sort=created'), with 'social_activity' as the repeater field?
      Tried this but it didnt work 😞 
      Any help appreciated! 
    • By theoretic
      Hello there! And thanks for Processwire.
      Got one more interesting question. One of my templates called goods has two repeaters. The first one is variants, each item containing possible sizes, colors and so on. The second one is available_variants, each item should contain a region and a variant which should be selectable from the list of variants.
      So the task is to get items of one repeater from inside the page reference field which is the part of another repeater, both repeater belonging to the same page.
      Processwire gives some options for retrieving selectable pages in this case. We can use:
      Parent. Not an option because we need dynamic parent being in fact the current page which contains both repeaters. Template. Not an option again because we need to select repeater items not only by template but also by page id which is dynamic. Custom find. Could be a solution but have no idea how to substitute the current page id into ID query. Selector string. It's almost what we need, but again i have no idea how to substitute something like "parent={$parent->id}" in this case. Custom PHP code. This needs to be placed inside site/ready.php and should contain a hook which finds pages using all the power of PW API. Think that the last option is the solution, but could not get the result i need.
      The simplest possible way seems to use $event->arguments('page')->variants. But it returns nothing. Tried different selectors like "template=repeater_variants, parent=".$event->arguments('page')->id , but still no result.
      Will be grateful for any help. Thanks in advance!
    • By ivineets
      Hi,
      Whenever I try to create a repeater field on my website, I get following error:
      General error: 3161 Storage engine MyISAM is disabled (Table creation is disallowed).
      If I still continue, it creates the field but doesn't allow storing any kind of data. How do I resolve this?  Is there any alternative to repeatable content that I can use?
       
      Thanks for your time.
       
       
    • By ethanbeyer
      Hello,
      I recently posted in this topic, but I decided to start my own thread because while I believe my issue is related to the one in that thread, they are not exactly the same:
       
      I have created a custom User Template in the method outlined in the docs. I am creating a directory, so it made sense that every page in the directory was a Directory Member, so they could log in and edit their own information while also keeping the entire directory protected behind a login wall.
      So the new user type is created: "directory-member".
      I then created two new roles: "member" and "directory-admin":
      The "member" only has the ability to View directory-member pages, and "profile-edit", which allows them to manage their own information. The "directory-admin" has the ability to edit any directory-member pages, and administer users. Some Directory Members are both, but all have at least the "member" role.
      The first hint that something was wrong was when I was testing a "member" user and I could not add a new item to a repeater on that profile. The url for the profile edit (this will be important shortly) is site.dev/admin/profile. The repeater is set up to load new items through AJAX. If this option is turned off, the rest of this issue is no longer completely valid. But as I have found what I believe to be a pretty large issue in the Processwire codebase, I thought it worth bringing up.
      See, every page (even a user) has a $page->editUrl() method, and it returns a URL like this: site.dev/admin/access/users/edit/?id=2096. That's all good and fine for users that have page-edit permissions, but if they don't, that link will resolve to the admin's equivalent of a 404.
      So the way that Processwire currently gets around this is by creating a specific editing area for a user to interact with only their profile: /admin/profile. And that works pretty nicely, except for the fact that nowhere is editUrl() ever made aware of the difference. editUrl() is not hookable, and whether or not a page is editable is based on the PagePermissions module.
      On top of that, there are several core modules that hardcode a search-and-replace (see InputfieldRepeater.module:627) where the editing screen is for Users. This doesn't allow for a huge degree of flexibility that is offered in other places throughout Processwire. If line 627 of InputfieldRepeater is changed from this:
      $editorUrl = str_replace('/access/users/edit/', '/page/edit/', $editorUrl); to this:
      $editorUrl = str_replace('/access/users/edit/', '/profile/', $editorUrl); ...the AJAX repeaters work. It's maddening!
      As is brought up in the thread I attached above, a lot of the features of page editing are missing within /admin/profile/, and it just makes for an altogether strange editing experience. A user who has "page-edit" permissions for templates other than directory-member, but does have "profile-edit" permissions, will see their user in the Page List, but cannot edit their Page unless they hover over the wrench and click the "Profile" link. It just seems - off.
      I think what this hinges on for me is that the editUrl() of the user should be "/admin/profile/" if that user is logged in (and their page should be editable from the Page List), or the "/admin/access/users/edit/" url; regardless of the URL, both links should resolve to the Page Edit screen, as the Profile Edit screen seems to be a unnecessarily neutered version of Page Edit.
    • By cst989
      I have a file I want to access with ajax:
      The purpose of this file is to iterate through a repeater, and get the image from each entry.
      The number of images in the image field is set to 1, and just for good measure, to return a single image.
      And my code:
      // site/ajax/processImage.ajax.php?group=1206 require_once($_SERVER['DOCUMENT_ROOT'].'/index.php'); $resourceGroup = (int) $_REQUEST['group']; // get the Repeater field $resources = $pages->get($resourceGroup)->resources; foreach ($resources as $resource) { echo $resource->title; // Works as expected echo $resource->image->url; // /site/assets/files/1259/ echo $resource->image; // filename.jpg echo $resource->image->description; // nothing } See comments above for what is output, why isn't URL giving me a full URL, and no description is available?
      If I try to access $image->size() I get the following fatal error:
      Error: Uncaught exception 'ProcessWire\WireException' with message 'Method Pageimages::size does not exist or is not callable in this context' in F:\sites\<sitename>\wire\core\Wire.php:519