Jump to content

Batch Child Editor


adrian

Recommended Posts

Upon a re-import of data (generated originally from BCE's export as csv feature), BCE appears to be treating the related field as type TINYTEXT (limiting to 255 characters), even though the field is defined as type MEDIUMTEXT  (collation: utf8_general_ci).

I've tested this a number of times.   Full paragraphs (i.e. greater than 1000 characters) that I copy into the field's textbox (using page edit) and then save, end up being cut off to 255 characters over and over upon a re-import of data.   Checked CSV and it contains the full paragraph.

Any idea as to why the predefined type is changing upon CSV import?

Link to comment
Share on other sites

  • 3 weeks later...

Can this module be used to export pages, add translations for content, and import them?

We have this huge website (over 7000 pages). We've used TextLanguage and TextAreaLanguage fields for all textual fields, and all image and file fields have their own description input boxes for different languages too.

Now we'd need to export all pages and send them to our translator so they can translate all site contents with their specialized programs, and a way to import the translations back to our site alongside the content in original language. Is this possible with BCE?

I've tried to export site contents, but can't figure out a way to include image/file descriptions, or any textual field's contents in other language(s).

This module has already been a huge help when initially building this site in question. We created most of the pages with Ryan's Import Pages from CSV module, and were able to modify them in batches with BCE quite a few times during further development. Massive time savings!

Link to comment
Share on other sites

  • 3 weeks later...

Hi!

I'm on 'PW' 3.0.21 with 'BCE' 1.3.0.

As for me 'BCE' in 'Export mode' doesn't shows 'AsmSelect' field to adjust children fields to be exported, as shown in your topic.

So according to the module description I must have

Screen Shot 2015-05-26 at 12.17.17 PM.png

but only get

post-4381-0-75231900-1465646226_thumb.jp

I've also tried to install 'Select Options' fieldtype core module, that enables 'AsmSelect ' fields to be used in templates, but nothing had changed.

Despite of mentioned above, an API exporting still works well.

Link to comment
Share on other sites

@tkaranka - multi-language is not currently possible, but we do have some functionality for multiple value fields which could be extended to support multilanguage - the catch is that I am not a ML user myself so I am not terribly familiar with it, although I would love to see BCE support it at some point. Either way I am glad it's been a big timesaver for you.

@feniks502 - 

Quote
As for me 'BCE' in 'Export mode' doesn't shows 'AsmSelect' field to adjust children fields to be exported, as shown in your topic.

This option is only available if you define separately configurable pages:

Screen Shot 2016-06-11 at 8.13.49 AM.png

and then you check this on the Settings tab of the page(s) selected above:

Screen Shot 2016-06-11 at 8.15.03 AM.png

But this is only necessary if you them to be able to select the fields to export. You can also define them yourself on the Settings tab of the page, here:

Screen Shot 2016-06-11 at 8.16.06 AM.png

Please let me know if it makes sense now!

Link to comment
Share on other sites

  • 1 month later...
12 minutes ago, Soma said:

When creating a bunch of children via CSV the pages aren't active in the alternative languages. Just caught me. 

Thanks for the report soma - I really have played with ML much at all - can you give me a quick rundown of what BCE needs to do to make this work as needed?

Link to comment
Share on other sites

Just now, Soma said:

You mean you haven't? Shame on you really!

Well you check for $languages more than 1 and then cycle each and set "status[langid]" to 1. 

True - see I can't even get my only language correct :)

I have played a little with it, but never had a need to actually use it so just wanted clarification from you to save me a little time.

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

Hi @adrian,

I'm currently trying this module to import my news from my old website to PW (3.0.28). I have 2 questions:

  1. Do I'm suppose to be able to import html? All <h>, <p>, etc are lost when I import. Either by copy-paste the text or using a CSV file. I tried different ways to escape but didn't get it. I also deactivate HTML purifier and some other stuff in input tab of my body field.
  2. I have some glitchs with CSV export in images or files field. I created a mockup page (values were just the title of the field). You will see that in images/files, the content of body is copied. However, if images/files are filled, they export correctly.

Thanks!!

Mel

PS I didn't try yet multilanguages, I hope it works!! ;-)

news.csv

Link to comment
Share on other sites

  • 3 weeks later...

Thanks adrian for this excellent module! I used it a lot in my projects.

Recently I upgraded my php version to 7 and found that the Add method and Update method for csv import(both by using textarea and files) failed. Only the title can be saved successfully but not other fields when I am using the Add method. However, I cannot confirm if it is the issue raised from the php upgrade. Just wonder anyone can use this module with php7?

I tried upgrade PW and reinstall the module but no luck. Thanks for reading.

Link to comment
Share on other sites

  • 2 weeks later...

Let me reply the above issue by myself.

I have tried using this module with freshly installed php7 and php5.64 xampp. The result is that the Add and Update function using csv is not working in php7 but php5.64. However I am not smart enough to figure out why is this happening. I hope this information is useful to somebody. 

Link to comment
Share on other sites

Hi @Karl_T and @mel47 - I am very sorry for the lack of response here. I have been low on time lately and spending most of it on TracyDebugger.

@mel47  - I'll look into the html tags being lost on import - any chance you could PM me the file you are trying to import?

@Karl_T - I know what the issues will be - just need to set myself up with a PHP7 testing environment and track them all down.

I'll see what I can do about getting both of these taken care of this week.

Thanks for your patience.

  • Like 3
Link to comment
Share on other sites

On 7/25/2016 at 8:02 AM, Soma said:

When creating a bunch of children via CSV the pages aren't active in the alternative languages. Just caught me. 

Sorry for the crazy delay on this @Soma but I think it should now all work as expected.

Would there be any reason to make this a config option? Would anyone not want new pages to be automatically activated? Could it be a module-wide setting, or would it need to be part of the interface where the new pages are added?

Link to comment
Share on other sites

Just now, Zeka said:

I think that it is the best option

So to clarify, there are time when you wouldn't want newly added pages automatically activated in all other languages? (Sorry not a ML user so not sure how most people work). Do you think it should be checked or unchecked by default?

@mel47 - I took a look at the html tag issue - was a very easy fix (just committed) - sorry I hadn't come across this before. I was sanitizing as "text" - now I am using the "purify" sanitizer - hopefully that will work for everyone in all scenarios, but if anyone notices a problem, please let me know.

 

  • Like 1
Link to comment
Share on other sites

1 minute ago, adrian said:

So to clarify, there are time when you wouldn't want newly added pages automatically activated in all other languages? (Sorry not a ML user so not sure how most people work). Do you think it should be checked or unchecked by default?

Yes, you are right. Very often only few pages have translation to all languages. ( Ukraine is not english speaking country and almost all blogs have only about 10% of posts translated to other languages ). 
It should be checked by default, IMHO.

  • Like 1
Link to comment
Share on other sites

An option when creating would be nice option. It's not always content pages bit also pages as categories etc. Maybe even some field in csv could be used to do it on a per entry basis. I would go for something like this. In the case of such a feature the more option to do such things the better.

  • Like 1
Link to comment
Share on other sites

1 hour ago, Zeka said:

Yes, you are right. Very often only few pages have translation to all languages. ( Ukraine is not english speaking country and almost all blogs have only about 10% of posts translated to other languages ). 
It should be checked by default, IMHO.

 

Ok, I have added the checkbox:

Screen Shot 2016-09-06 at 12.02.23 PM.png

4 minutes ago, Soma said:

Maybe even some field in csv could be used to do it on a per entry basis.

Not sure how best to implement this cleanly. If it was a simple matter of checking if there was an additional field at the end of the row that was 1 or 0, that would be ok I guess, but with the CSV field pairing functionality and it's checks, I think it is going to start to get a bit messy, but if you think it would be really worthwhile, let me know and maybe I'll revisit it.

  • Like 2
Link to comment
Share on other sites

Of course you're right. I think it would be possible but maybe little messy. I'm not into this module much (used it once), but maybe on the child editor some feature for setting the active languages via checkboxes would be a better way?

Link to comment
Share on other sites

1 minute ago, Soma said:

but maybe on the child editor some feature for setting the active languages via checkboxes would be a better way?

Sounds useful, but I'll wait and see if there is demand. I don't honestly know how many people are using this module anyway, let alone with ML setups.

Link to comment
Share on other sites

The latest version now uses a proper csv parser, not php's str_getcsv so now it supports line breaks within csv "fields". This should deal with the problem that @elabx reported earlier this year - sorry it's been so long coming.

I'd love to hear how this new parser works out for everyone's CSV importing needs. If it seems good, then I will also start using it in my Table CSV Import/Export module: http://modules.processwire.com/modules/table-csv-import-export/

Thanks for any feedback.

Does anyone else have anything outstanding that needs fixing?

  • Like 3
Link to comment
Share on other sites

Hi Adrian, thank you so much for the work you put into this module! It's really making life a lot easier.

I've read through this thread and seen that you considered setting the CSV field pairings per template rather than per page. Could you re-consider this option, or point me into the right direction of what I need to tweak to use the module this way? Alternatively it'd already be really helpful if it weren't necessary to add each configurable page separately, but to allow all children, grandchildren etc. of a page to be configurable too.

Since that probably helps understanding my issue, here's a little background: I work with a nested page structure in which the parent (A) has a number of children (B) which I'd like to import. Each of these children (B) will have between, on average, one and ten child elements (C), each of which again has at least one child. The current module settings would require me to add each of the children (B) and grandchildren (C) separately to the list of configurable pages in the module settings. Which also means my colleagues - who're not superusers - cannot import anything but the children on the first level (A) on their own, as they have no access to the module configuration and the settings tab, and B and C are only created with the imports.

(The easiest solution of course would be to import the pages without field pairings. However, that failed on my local testing environment every way I tried it. Even if the fields were all present in the CSV, and in the same order as in the template settings, the title field never imported correctly.)

Link to comment
Share on other sites

Hi @Naz - glad you like the module and welcome to the forums.

I can totally understand the issue you are having with the way I have the configuration set up. Ideally having it by template would also be useful - unfortunately I don't think it will be a simple change so I am wondering if we can figure out why you are needing the field pairing to be set up if you have matching numbers of fields in the CSV file.

Are you using the latest version of BCE? Could you perhaps send me a test CSV file to work from?

Link to comment
Share on other sites

@adrian sorry for the delay. I finally was able to test it, and it rocks! html tags are now imported correctly. I still have difficulties with export : when some fields (images or files) are empty, the content of body field is replicated.

Concerning multilanguage, could you give an hint of how to use it? Do I can import in 2 languages at the same time? Anyway, I discovered a workaround couple weeks ago. If I changed default language, I could import in this language. So I will do 2 imports, which is not so bad, considering I planned to used it only once to migrate my website content.

Thanks

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...