MarkE Posted January 11, 2023 Posted January 11, 2023 This is a s lightly obscure issue, but hopefully very easy to deal with. If a page only has one child, then the child doesn't necessarily have a sort attribute. In this case, BatchChildEditor will add a sort attribute and save the page. This seems to me to be unnecessary (and is causing a small problem with a module of mine). Is it possible and reasonable to not set the sort if there is only one child? The relevant code is at the end of the saveChildren() method: $cp->sort = $i; if($cp->isChanged()) { $cp->of(false); $cp->save(); } I think it would need something like: if($this->wire('input')->post->individualChildTitles->count() > 1) { $cp->sort = $i; } if($cp->isChanged()) { $cp->of(false); $cp->save(); } but maybe there is a better solution? 1
adrian Posted January 12, 2023 Author Posted January 12, 2023 Hi @MarkE - looking at the pages DB table, it seems that in reality I should just be setting the sort values starting at 0 and not 1. Not sure why I set it up this way - seems like generally it doesn't matter, but setting the first child page to 0 should work for you I believe. I have made that change for the latest version - can you let me know how it goes for you please? 1
MarkE Posted January 13, 2023 Posted January 13, 2023 3 hours ago, adrian said: I have made that change for the latest version - can you let me know how it goes for you please? New version seems to do the trick. Thanks @adrian. 1
virtualgadjo Posted January 20, 2023 Posted January 20, 2023 Hi, sorry if the question ha&s already been asked... couldn't find out is it possible to export multi language fields at once, i.e a web site in fr and en, can i export both values for each field when they are multilingual thanks for any tip ? have a nice day
adrian Posted January 20, 2023 Author Posted January 20, 2023 Hi @virtualgadjo - it's only one language at a time IIRC. The problem with multiple is how to arrange the data in the export. Different users will need different layouts so it's best to generate these sorts of exports yourself. I tend to use AdminActions to create these sorts of custom imports. 1
virtualgadjo Posted January 21, 2023 Posted January 21, 2023 hi @adrian and thanks a lot for your answer, i'll try tu use AdminActionh for this too, didn't think of this although i often use AdminActions for many other purposes ? i've solved my current problem using batch child for the fields i need in the default language adding the page id to the field list and using Ryan recent ProcessLanguageFieldExportImpor to export the multi language ones then i just had to agregate both csv based on the page ids you're right, my first thought was to write my own code but pw does so many things "by itself it must have made me a little lazy ? have a nice day
digitex Posted March 17, 2023 Posted March 17, 2023 I'm trying to export to csv a list of current member users. There seems to be no way to do this without listerPro. Does Batch Child Editor allow you to export any admin pages? /EDIT I was looking in the wrong spot. I was looking for export function under Access > Users in the drop down on the top bar but when I went to Admin > Access > Users -- Edit in the page tree, I was able to make it work. For anyone looking for that functionality maybe that helps. Thanks Adrian.
adrian Posted March 17, 2023 Author Posted March 17, 2023 Not sure what you are making work via Admin > Access > Users, because to get BCE to work here like that, I need to replace line 185 with: if(!$this->data['allowAdminPages'] && (!in_array($this->editedPage->id, $this->wire('config')->usersPageIDs) && ($this->editedPage->template->flags & Template::flagSystem))) return;
digitex Posted March 17, 2023 Posted March 17, 2023 54 minutes ago, adrian said: Not sure what you are making work via Admin > Access > Users, because to get BCE to work here like that, I need to replace line 185 with: if(!$this->data['allowAdminPages'] && (!in_array($this->editedPage->id, $this->wire('config')->usersPageIDs) && ($this->editedPage->template->flags & Template::flagSystem))) return; Don't know buddy, I guess you're just that good. ?
digitex Posted March 29, 2023 Posted March 29, 2023 (edited) Hey Adrian, New issue, different project. I set up a tracking system for a client that wanted to keep a record of all downloads of a certain file they offer on their site. Only logged in users can access the file and on download a page is created under user tracking showing the user name, date of dl etc. They also wanted to export that list as a csv so I'm using Batch Child Editor to give them that function and it worked well for a while but now there's 6800 ish pages in user tracking and whenever they attempt to export it throws an error: Error: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away. They are on shared hosting so resources are limited so I told them that with the csv they have they should delete the older pages but even that fails so I had to use phpMyAdmin. Lister has no problem handling the volume but BCE does so are you aware of a limit to BCE and is there a way around it? ------------ I believe the issue is that the BCE editor is displaying all of the child pages at once and with so many, that's what chokes it. If it's possible to implement some kind of pagination it should fix the problem. Edited March 30, 2023 by digitex
adrian Posted April 7, 2023 Author Posted April 7, 2023 Hi @digitex - you're right about the displaying of all the child pages - this module really doesn't work well in edit with lots of children - poor design on my part :) That said, I think if you disable edit mode for branches with lots of children, you should be able to offer the CSV export mode and I think it should be ok. It won't be as capable as Lister still because Lister batches exports whereas BCE tries to do all in one batch. I really haven't used this module in a long time so I'm afraid I don't have much impetus to modify the export functionality, but hopefully it will work for you with edit mode disabled.
Matthieu Posted July 6, 2023 Posted July 6, 2023 Hello ! Is it possible when export to have the caption of images ? actually the csv contains only the URL of images. Thanks for your help, Matthieu
nexuspolaris Posted December 12, 2023 Posted December 12, 2023 Hi @adrian ! I would like to use the module to update map marker address field but the CSV field pairings feature seems hidden for me: I selected the parent page in the Configurable pages what else did I miss?
adrian Posted December 13, 2023 Author Posted December 13, 2023 The field pairings is only available from the Settings tab of those pages selected under Configurable pages. Does that help?
nexuspolaris Posted December 15, 2023 Posted December 15, 2023 On 12/13/2023 at 9:31 PM, adrian said: The field pairings is only available from the Settings tab of those pages selected under Configurable pages. Does that help? I want to update map data on City pages and I followed your instructions from here: This is how my settings in city's parent page looks like: The format of the CSV what I uploaded: City1 name,City1 name,41.88700499999999,-87.64885009999999 City2 name,City2 name,47.474851,20.5913671 City3 name,City3 name,79890229999999,20.0036779 ... After uploading the cities map data is empty. Could you help me?
adrian Posted December 18, 2023 Author Posted December 18, 2023 @nexuspolaris - the screenshot you posted is not for the settings tab of that page. Please enter those field pairing in the BCE settings on the Settings tab.
TomPich Posted February 10, 2024 Posted February 10, 2024 Hey there, I’ve been playing around with BCE. I love all its functionalities and will need it for a project very soon. A quick question though : when in lister mode, you can define filters, and that’s great. But I could not find how to predefine blank filter. Imagine that my client will frequently use a filter on a field called "place". How can I get this filter ready to be filled, like "Place" + "contains texte like" + _blank_ ? Otherwise, he will always have to pick the right field and the right matching condition each time he lands on the page. And BTW, is there any way to hide the filter "Parents" "equals" "id" ? Because this is implicit and my cause confusion to my client. Many thanks in advance ?
adrian Posted February 10, 2024 Author Posted February 10, 2024 Hi @TomPich - the latest version allows blank default filters and hides the parent selector (I moved it from defaultSelector to initSelector). 1
TomPich Posted February 10, 2024 Posted February 10, 2024 That’s great @adrian ! I had 1.8.25. The new one does exactly what I needed ! ? 1
virtualgadjo Posted April 2, 2024 Posted April 2, 2024 Hi, funny little problem; if i allow the users to modify the export settings and, for example just want to export the children IDs and titles, il doesn't export a csv at all but tables containing php errors --- Notice: Trying to get property 'type' of non-object in D:\wamp\www\terrapixa\epifnew\site\assets\cache\FileCompiler\site\modules\BatchChildEditor\ProcessChildrenCsvExport.module.php on line 248 Notice: Trying to get property 'type' of non-object in D:\wamp\www\terrapixa\epifnew\site\assets\cache\FileCompiler\site\modules\BatchChildEditor\ProcessChildrenCsvExport.module.php on line 254 --- same thing if i just try to add the ids to the original field list funny enough, everything works like a charm if i delele this user permission, nice csv as the output but, too bad, without the children ids ? have a nice day --- 1
adrian Posted April 2, 2024 Author Posted April 2, 2024 Hi @virtualgadjo - sorry about that - should hopefully be fixed in the latest version.
virtualgadjo Posted April 2, 2024 Posted April 2, 2024 Hi @adrian thanks a lot for taking time to answer ? and don't worry, it will just be the opportunity for me to write my own little module to do this for this website specific needs and i love writing modules for pw ? have a nice day
adrian Posted April 2, 2024 Author Posted April 2, 2024 I am confused by your response - you can write a module to do it if you want, but the problem you had with those errors should now be fixed, so you should be able to use this module now. 1
virtualgadjo Posted April 2, 2024 Posted April 2, 2024 Hi again @adrian wow, faster than the light speed, just downloaded the last release and, yes, it works really well, thanks so much!!! and, you know, don't be confused by my response, it's just that i thought you may have something else to do than reacting that fast, i'm stunned and at the same time it's so pw like ? i should be used to it thank you very much again and have a nice day, mine is even nicer, saved some time thanks to you ? 2
virtualgadjo Posted May 19, 2024 Posted May 19, 2024 Hi, here again ? i'm running into a funny little issue on a website that has a page with many children (714 so far), some of them hidden, some not, some of them already unpublished, some not, if i try to unpublish all the children i get this error -- ProcessPageEdit: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicata du champ 'weekendatbinnys-champagne-tasting-1021' pour la clef 'name1019_parent_id' -- the funny thing being that using your admin actions module, i've created my own action to unpublish all those pages (that have the same template), just adding include=all to my find protected function executeAction() { $ps = $this->wire('pages')->find('template=un_event, include=all'); foreach($ps as $p) { $p->addStatus(Page::statusUnpublished); $p->save(); } return true; } it works like a breeze ? so, actually not really a problem for me but just for you to know ? the other funny thing is if i try to "repuiblish" all of them using the batch child editor i get this error again and... it only "republishes" the pages that were hidden at the beginning of the loop (it's a real life website and the client often "plays" with the page status along the events validation) this tends to make me think it's an include thing somewhere this makes me think too that i may go a little further with this custom action to let choose the pages to unpublish/publish by their template, parent, and so on and, of course, thanks again for those modules i really like playing with ? have a nice day
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