Jump to content

Batch Child Editor


adrian

Recommended Posts

Hi @Klenkes - I decided to go with #2 - now BCE will only apply the "purify" sanitizer if the field that is being populated/updated has the HTMLPurifier enabled. 

Could you please test at your end to make sure it works as expected?

Thanks!

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

Hi @adrian I would like to use BCE for simple CSV export and re-import for the first time. Is that possible with the module? I'm stuck right at exporting... :( I have two issues:

  1. child page specific fields are not seen in the dropdown select (Fields to export). 
  2. no matter what my setting are, I only get 0 byte (ie empty) files
  3. bonus minor issue: :) Export button keeps sticking out of the page, cropped in half

What I am doing wrong? I browsed this topic but it's extremely long and I got lost...

bce-export.thumb.jpg.7dbb92e97d0d1c5a9a58750c4491294f.jpg

Edited by szabesz
typo
Link to comment
Share on other sites

Hey @szabesz - I just did a check of everything here and I can't reproduce any of these issues (although #3 is probably a Reno specific thing which I'll check in a minute).

Could you perhaps help me debug - firstly the missing child page template fields - those are collected here: https://github.com/adrianbj/BatchChildEditor/blob/fe93376a2846df53eba4b102bc5d5ba89f52e09f/BatchChildEditor.module#L938-L943

It would be great if you could add: bd($allFields); at line #944 and check the names of each of the contained fields in the array or let me know if this is empty for some reason.

Once we figure this out, we'll get onto why the CSV might be empty.

  • Like 1
Link to comment
Share on other sites

Thanks for jumping in so quickly!

30 minutes ago, adrian said:

empty for some reason

I figured it out in the meantime: all the products are hidden currently because I use Page Protector's "Protect Hidden Pages" to makes sure nothing is leaking on a live site while in development :) No result set, no fields and no records either. At least I would expect the Fields to show up. Of course empty file is expected in this case. Is it possible to send a message for dummies like me in such a case? :-[

Anyway, it would be great to be able to include=all because I will be needing to export/import no matter what the page status flags are. Is it possible?

Edited by szabesz
typo
  • Like 1
Link to comment
Share on other sites

Thanks for figuring that all out!

I have just committed a new version which supports a new option for choosing "hidden" or "all" for the child pages to be exported. I have also fixed the missing fields (when child pages are hidden/unpublished). And, I have also fixed the export button in the Reno admin theme.

Please let me know if it works ok at your end now.

Link to comment
Share on other sites

11 hours ago, adrian said:

Please let me know if it works ok at your end now.

Thanks a lot! The button in Reno is ok and fields in "Fields to export" are listed. However, I'm still getting empty files with both All and/or Hidden (Pages to include). Also, even though the "Fields to export" select dropdown lists all fields,

  1. the selected fields are not saved with the page.
  2. "Pages to include" does not "stick" (saved) either.

BTW, probably because I got used to ListerPro, yesterday I expected the exported records to match the result of the Lister of List Child Pages. Would it be possible to reflect this result set when switching to either Edit or Export mode or is BCE conceptually different? 

Link to comment
Share on other sites

Hey @szabesz - I have fixed the issue with the page specific settings not being populated to the CSV export interface (new version now available), but I can't reproduce the problem you are having with an empty CSV file. Make sure you do a hard reload of the page to ensure the update JS file in this module isn't being cached. If that doesn't help, we'll try again :)

3 hours ago, szabesz said:

BTW, probably because I got used to ListerPro, yesterday I expected the exported records to match the result of the Lister of List Child Pages. Would it be possible to reflect this result set when switching to either Edit or Export mode or is BCE conceptually different? 

I am not sure I understand this - are you wanting a way to filter which pages will be exported? I guess I could add an InputfieldSelector field to the export options to limit the child pages that are exported to the match selector. Is that what you are looking for? 

  • Like 1
Link to comment
Share on other sites

2 hours ago, adrian said:

I guess I could add an InputfieldSelector field to the export options to limit the child pages that are exported to the match selector.

 

I decided to go ahead to do this so now you can specify exactly which pages will be exported. Hopefully others will find this useful also:

59a59afd39c8a_ScreenShot2017-08-29at9_48_25AM.thumb.png.9894f14c4bb7947dc309967682ac8e37.png

 

  • Like 3
Link to comment
Share on other sites

Thanks a lot Adrian, in this version (1.6.13) the export works as expected.

1 hour ago, adrian said:

I decided to go ahead to do this so now you can specify exactly which pages will be exported.

Yeah, I was hoping for this! It is not exactly what I was trying to explain but even better than that ^-^ I wonder if you could add it to the edit mode too. I have the filter of AOS there but that one is just a limited "workaround".

One more issue remains though: I was hoping to be able to save the settings of "Pages to Include" and "Fields to Export". Not in the module's Settings but on an individual "Configurable page" however the latter does not work, or it is just me who could not figure out how to save them.

Link to comment
Share on other sites

16 minutes ago, szabesz said:

Yeah, I was hoping for this! It is not exactly what I was trying to explain but even better than that ^-^ I wonder if you could add it to the edit mode too. I have the filter of AOS there but that one is just a limited "workaround".

I could easily add it as a config setting on each individual configurable page, but I am guessing that this is something you would want to change potentially each time you visit the children tab - this might make for some complex ajax/js, but I'll take a look.

18 minutes ago, szabesz said:

One more issue remains though: I was hoping to be able to save the settings of "Pages to Include" and "Fields to Export". Not in the module's Settings but on an individual "Configurable page" however the latter does not work, or it is just me who could not figure out how to save them.

The settings I save from the parent configurable page (both Pages to Include and Fields to Export) are working fine where when I go to export they are pre-selected. Are they saving on the page's settings when reloaded and just not appearing in the BCE interface on the children tab, or are they not saving at all? 

Any chance I get access this site online somewhere?

 

Link to comment
Share on other sites

39 minutes ago, adrian said:

 I wonder if you could add it to the edit mode too.

Have you played around with "Lister" mode - maybe that would suit your needs already, rather than me adding a selector to "Edit" mode. I know the Lister mode isn't perfect, but it's pretty useful in the way it lets you define and adjust columns to show and the inline edit mode (if you have Lister Pro installed). Anyway, just an idea.

  • Like 1
Link to comment
Share on other sites

1 minute ago, adrian said:

Have you played around with "Lister" mode

Well, maybe Lister and Edit mode could be "merged" somehow? I am just thinking out loud... If I were to sketch up a GUI for it, would you support a discussion about this "merger"?

Link to comment
Share on other sites

1 hour ago, szabesz said:

Well, maybe Lister and Edit mode could be "merged" somehow? I am just thinking out loud... If I were to sketch up a GUI for it, would you support a discussion about this "merger"?

I would love to see your mockup of a GUI for it. No promises though I'm afraid - there is a LOT going on in Edit mode and I am not really sure how that would fit in with Lister, but if it looks doable and others here sound interested, I'd be willing to give it a go.

  • Like 1
Link to comment
Share on other sites

1 minute ago, adrian said:

No promises though I'm afraid

That's ok, of course. I put it on my todo list. I do not need such a UI currently but I will be developing a site where it would save a lot of clicking for the editors.

Link to comment
Share on other sites

  • 2 months later...

Hi

Just a confirmation question: repeater is not supported?

I was wondering if it could be possible to have in exported csv :repeater1_field1, repeater1_field2, repeater2_field1, repeater2_field2, etc...

If not, which solution could be a replacement? I really need a CSV for this project. The repeater contain 3 fields : eventdate, timebegin, timeend, which should be tied (can't really use pageref field).

Thanks again!

Link to comment
Share on other sites

Hi @mel47 - you are correct that repeaters aren't supported. I do support some other multi-value fields, but repeaters are more than multi-value, they are also multi-item (if that makes sense) which is where it gets complicated because not everyone will want the export to be formatted the same way. Just to clarify - you are wanting BCE to export your repeater items, rather than import a CSV of items into a repeater field?

I see in your example how you want the export to look but the problem is that different child pages can have different numbers of items in their repeater fields which will mess up the CSV export - nothing will line up properly. This will be especially bad if you have "Column Labels" turned on.

I am just not sure that there is a good universal way to export repeaters to CSV. If someone comes up with one, then I will happily implement, but otherwise, I think it's going to be a bit of a mess. 

That said, I have just committed a new version that fixes quite a lot of CSV export bugs!

It also includes my experiments with Repeater support. They are commented out though, so you will need to uncomment:

https://github.com/adrianbj/BatchChildEditor/blob/ca338ff0cb6f784579a370ff5e5f2fb71c3eeb85/ProcessChildrenCsvExport.module#L144-L154

https://github.com/adrianbj/BatchChildEditor/blob/ca338ff0cb6f784579a370ff5e5f2fb71c3eeb85/ProcessChildrenCsvExport.module#L196-L205

and then comment out these:

https://github.com/adrianbj/BatchChildEditor/blob/ca338ff0cb6f784579a370ff5e5f2fb71c3eeb85/ProcessChildrenCsvExport.module#L177

https://github.com/adrianbj/BatchChildEditor/blob/ca338ff0cb6f784579a370ff5e5f2fb71c3eeb85/ProcessChildrenCsvExport.module#L128

  • Like 1
Link to comment
Share on other sites

Hi @adrian

Thanks so much to have try so quickly. Unfortunately it doesn't work, for now at least! ;-)

no repeater: shifting

1 repeater: ok

2 repeaters: shifting.

I add an excel sheet with color showing shiftings.

In my limited knowledge, I will guess that you have to count the maximal number of repeaters and created this number of columns. And let them empty if there are not necessary. But I really don't know if it's do-able.

Also. Strange thing. Normally, when a field is a page, it's title that is displayed. But for repeater field, it's id (date in my example).

Mel

On 06/11/2017 at 8:01 PM, adrian said:

Hi @mel47 - you are correct that repeaters aren't supported. I do support some other multi-value fields, but repeaters are more than multi-value, they are also multi-item (if that makes sense) which is where it gets complicated because not everyone will want the export to be formatted the same way. Just to clarify - you are wanting BCE to export your repeater items, rather than import a CSV of items into a repeater field?

I see in your example how you want the export to look but the problem is that different child pages can have different numbers of items in their repeater fields which will mess up the CSV export - nothing will line up properly. This will be especially bad if you have "Column Labels" turned on.

I am just not sure that there is a good universal way to export repeaters to CSV. If someone comes up with one, then I will happily implement, but otherwise, I think it's going to be a bit of a mess. 

That said, I have just committed a new version that fixes quite a lot of CSV export bugs!

It also includes my experiments with Repeater support. They are commented out though, so you will need to uncomment:

https://github.com/adrianbj/BatchChildEditor/blob/ca338ff0cb6f784579a370ff5e5f2fb71c3eeb85/ProcessChildrenCsvExport.module#L144-L154

https://github.com/adrianbj/BatchChildEditor/blob/ca338ff0cb6f784579a370ff5e5f2fb71c3eeb85/ProcessChildrenCsvExport.module#L196-L205

and then comment out these:

https://github.com/adrianbj/BatchChildEditor/blob/ca338ff0cb6f784579a370ff5e5f2fb71c3eeb85/ProcessChildrenCsvExport.module#L177

https://github.com/adrianbj/BatchChildEditor/blob/ca338ff0cb6f784579a370ff5e5f2fb71c3eeb85/ProcessChildrenCsvExport.module#L128

 

activites.xls

Link to comment
Share on other sites

  • 1 month later...

Hi everyone,

@bbeer has kindly sponsored support for CSV import creation of multilanguage content in child pages.

You can "Add" new pages in your default language, and then use "Update" mode to add the content for other languages - this is done with separate CSV files for each language.

This feature should be considered an early beta version at the moment, so please backup your database first and test carefully on a dev version before deploying live.

Let me know if you come across any issues.

Thanks again to @bbeer !

  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...

Happy new year all :) 

That's great news about the multilanguage import. I'm blown away by how regularly great new features appear in both the core and in lots of modules!

I had a quick question about regular non-multilingual csv imports - I was having trouble with an import whereby the existing titles weren't matching. I think it may be due to the titles having lots of punctuation (they're product codes which I have no control over).

I am not familiar with the workings of this module, and was last-minute clutching at straws before the holidays - this seemed to resolve the errors I was seeing:

Added after line 1674 in BatchChildEditor.module

$title = $this->wire('sanitizer')->selectorValue($childFieldValue);

I'm not sure of the cause or consequence of this, would it be helpful if I provide more details of the error message I see without this line?

Thanks,
Tom

Link to comment
Share on other sites

Hi @sodesign - thanks for looking into a solution for this issue. Are you using the latest version? It just seems like the location where you are adding that (after line 1674) is probably too late to be useful in the latest version.

It would definitely be great if you could provide the error you are getting, and what line it's on, as well as the title that is not being successfully matched. Also, based on where you are adding that line it looks like it's matching of a page reference field title that's the issue - is that correct?

 

Link to comment
Share on other sites

When I run the import without the line, I get the error:

2298×
PHP Notice: Undefined variable: title in .../modules/BatchChildEditor/BatchChildEditor.module:1676

The csv is 982 lines long, and 5 page reference fields are being imported, though quite a few of the values are empty.

Is there any other information I can provide to help?

 

 

Link to comment
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
×
×
  • Create New...