dewwwald Posted April 2, 2015 Share Posted April 2, 2015 If you have a repeater that is already being used, in a template, and containing content, ie $repeater |_ body (this can be any field) |_ image (this can be any field) And you add a filed to said repeater, $repeater |_ body (this can be any field) |_ image (this can be any field) |_ summary (this can be any field)When you want to update existing instances of that repeater item the it does not want to save that repeater field, I cant delete upload or add new items to this repeater. Is this a bug? Do you need more info? Should I make an issue? Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 2, 2015 Share Posted April 2, 2015 I just tested this on a fresh install and can't seem to reproduce it. At least not without an image field. Which version are you using? Do you get any errors (php or js)? Link to comment Share on other sites More sharing options...
dewwwald Posted April 2, 2015 Author Share Posted April 2, 2015 Hi @LostKobrakai, Thanks for the swift reply. I am getting no errors in admin. I am using the latest version of ProcessWire (free) as found on github master branch. When I delete a file after the repeater update I get this messages at the top, http://snag.gy/CyTUr.jpg Did you follow my instructions carefully? -- Edit introduce spec -- starting point - repeater contains field - repeater is used in a template - repeater has content - lets add a file field with content to be sure introduction of error can be done by - making an update to repeater field by adding new fields Test If error works - delete file field content - save page -- Edit end -- I am using a file field in my live version of this issue, this might be where the problem starts as you said you needed an image to reproduce the issue. I can resolve it, and have in the past by redoing everything in the field with my updates. Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 2, 2015 Share Posted April 2, 2015 Even on the master branch and with an image field I can't reproduce it. I can add fields to the repeater and have no problems updating previously created repeater items. Any errors in the javascript console regarding the image upload? What modules do you have installed? Link to comment Share on other sites More sharing options...
dewwwald Posted April 2, 2015 Author Share Posted April 2, 2015 I can upload a new pdf in the place of the old one, but i can not delete the existing one, having an empty field. Field is not required. No js errors. -- edit introduce -- I want to emphasize that please follow the post instructions taking in to account the clarifying description If you have a repeater that is already being used, in a template, and containing content, ie $repeater |_ body (this can be any field) |_ image (this can be any field) And you add a filed to said repeater, $repeater |_ body (this can be any field) |_ image (this can be any field) |_ summary (this can be any field)When you want to update existing instances of that repeater item the it does not want to save that repeater field, I cant delete upload or add new items to this repeater. Did you follow my instructions carefully? -- Edit introduce spec -- starting point - repeater contains field - repeater is used in a template - repeater has content - lets add a file field with content to be sure introduction of error can be done by - making an update to repeater field by adding new fields Test If error works - delete file field content - save page -- Edit end -- Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 2, 2015 Share Posted April 2, 2015 I did exactly that and it's working for me. Could you try to reproduce it in a blank installation by yourself and export it as site profile (http://modules.processwire.com/modules/process-export-profile/)? This way we can eliminate modules and such things from interfering. 1 Link to comment Share on other sites More sharing options...
dewwwald Posted April 2, 2015 Author Share Posted April 2, 2015 Modules installed are ProcessRedirects, MarkupSImpleNavigation, MarkupSitemapXml. After extensive testing I reproduced this by adding another repeater to the same page that already has another repeater. Disabling said modules does not fix the issue. I introduced the error after finally installing MarkupSimpleNavigation (the last of the modules) and adding a second repeater with the same fields to the same page. I will make a site profile export, but don't see the need. But here is a headsup on how this was done. Link to comment Share on other sites More sharing options...
dewwwald Posted April 2, 2015 Author Share Posted April 2, 2015 Here is the site profile that broke the repeaters. Steps taken - Install - add repeater item - set up file and page item to work, use max 1 and null if empty, set template | parent page - add page, title and file to repeater - add repeater to a template - add items to repeater - add an image to the repeater, be sure to set up 1 max and null if empty - add module ProcessRedirects - Make changes to repeater by adding another field, I added a checkbox that when checked makes a field available - add module MarkupSitemapXML - Nothing broke yet - fiddle with the repeater template setup - hmmmm add MarkupSimple navigation - add a repeater_2 field - add fields in repeater one - add repeater to same page - broken repeaters - remove MarkupSimpleNavigation - does not fix the issue - add markup simple navigation - make a site export Here we are. site-BreakRepeaters.zip Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 3, 2015 Share Posted April 3, 2015 It's sad to say, but even your siteprofile does work as expected for me. The only difference left would be the php version you're running. Link to comment Share on other sites More sharing options...
cstevensjr Posted April 3, 2015 Share Posted April 3, 2015 (edited) I am using the latest version of ProcessWire (free) as found on github master branch. Could you please list your actual version numbers (PW, PHP, MySql, Apache)? Thanks Edited April 3, 2015 by cstevensjr Updated to add MySql Link to comment Share on other sites More sharing options...
dewwwald Posted April 4, 2015 Author Share Posted April 4, 2015 Okay, I think I am going to try and do something: - Make repeatable steps that wont fail, (for me at least) - Clearly define these steps at every point and turn - As suggested by one of my mentors I will also create a diff of the db dump before it breaks and after it breaks at the point I find it breaking. eta Monday 6th 17h00 GMT+2. For now here is my details of the machine I am working on. - Ubuntu 12.04 (I know I'll update asap...) - Apache version 2.2.22 - php 5.4.39-1+deb.sury.org~precise+2 (cli) - mysql Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.2 - PW version 2.5 - as said I did this with a master branch clean install I really would like to get to the bottom of this, helping you guys where I can, I am however swamped at current time, but will try my best to help as much as I can, please understand. Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 4, 2015 Share Posted April 4, 2015 No problem. We all have to do this besides work. I'm curious, if the db dump will show any differences, as it seems to work for me with your siteprofile and therefore the same database (besides the user profile). 1 Link to comment Share on other sites More sharing options...
dewwwald Posted April 6, 2015 Author Share Posted April 6, 2015 Going to start work on this about now-ish, I will create a github repo, with db exports est, so there will be no chance of the site profile exporter solving the issue, the workflow will therefore be, clone github repo, reference your vhosts (if used) and import the db dump. Good luck . --edit add github repo link-- https://github.com/dewald-laubscher/processwire --edit work in progress-- Structure to do this setup, now to move on to breaking stuff Link to comment Share on other sites More sharing options...
dewwwald Posted April 6, 2015 Author Share Posted April 6, 2015 After much attempting to break the repeaters I could not get it to break. I am not sure why as I followed the same steps. I will keep trying and reply to the post when I have had success. Link to comment Share on other sites More sharing options...
dewwwald Posted April 7, 2015 Author Share Posted April 7, 2015 Finally! I reproduced it by rebuilding my current projects admin, its something to do with conditional show and checkboxes. Will report asap. Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 7, 2015 Share Posted April 7, 2015 Repeaters are not officially supported by inputfield dependencies. 3 Link to comment Share on other sites More sharing options...
dewwwald Posted April 8, 2015 Author Share Posted April 8, 2015 Does not solve the issue, I have a workaround. Clearly this adventure was as a result of a lack of knowledge. As part of the splution I will explain what I have done and what the workaround was. LostKobrakai has stated: Repeaters are not officially supported by inputfield dependencies. This means that you should avoid inputfields in repeaters as far as I can gather. The use case Lets say I have a template that I call resources, this page has some basic content and also a repeater. The repeater Item can either be used for navigation to an internal page or a file that is uploaded and downloaded. So we want the user to lose or gain functionality based on what he or she wants the repeater to do. For instance we want page to show only if file is blank and we also want file to show only if page is blank. So one or the other will be used and not both. The broken solution Adding this here for the sake of completeness. I originally thought I would solve this issue by adding two checkbox fields to the repeater and have page and file hidden if their checkbox is not selected. Even more have the checkbox that shows the other field hide when the first checkbox is selected. I did this by using the 'hide only if' functionality found in processwire on the input tab of each field. There I simply added a condition 'checkbox=0' for the checkboxes and 'checkbox=1' for the field relating to the specific checkbox. Though this is a good solution that looks nice in admin. Its the very same thing that breaks repeaters. I think it might have been the page field having a condition. A work around My solution to this is to simply add the page and file field. Have the file field hide when page is populated (this does not work on page selector fields). Now have my php output the page field markup if it has an item else ill output the file field markup. Link to comment Share on other sites More sharing options...
cstevensjr Posted April 8, 2015 Share Posted April 8, 2015 You may want to eventually replace any Repeater solution you may have with a Page Table. 1 Link to comment Share on other sites More sharing options...
dewwwald Posted April 8, 2015 Author Share Posted April 8, 2015 I will argue that point, as page table, tough awesome and logical for a developer seems to have some complexity that a user, unfamiliar with processwire, might find complex. Although it can replace a repeater it is not always the most logical way to work. For what if the content is specific to that page or section of the page. It depends on the situation whether repeaters are good to use, other methods might be better for a dev, but look complex for a user. a kind of, "You want to keep your bananas away from your apples, or the apples might go down faster. " situation. After all CMS is supposed to be for a end user when it reaches them not for the dev. So their perspective is primary, especially since our paradigm is that of a super user. Link to comment Share on other sites More sharing options...
Macrura Posted April 8, 2015 Share Posted April 8, 2015 yeah, sometimes repeaters are quite essential and un-replaceable, as problematic as they are from the api perspective. where possible i try to use profields table, pageTable, multiplier, or textareas; but once in a rare while, those repeaters are good. 1 Link to comment Share on other sites More sharing options...
dewwwald Posted April 9, 2015 Author Share Posted April 9, 2015 See, I did not think further than repeater vs tables. But thanks for that insight to other alternatives. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now