Jump to content
adrian

Batch Child Editor

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?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

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

  • Like 1

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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. 

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

@Karl_T - I think your PHP7 issues should be fixed with the latest version. Please let me know if you find anything else amiss.

@mel47 - any chance of that test file that you are trying to import?

  • Like 2

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

would it need to be part of the interface where the new pages are added?

I think that it is the best option

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.)

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Process refunds and send customer notifications from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory (alpha version only available via GitHub) SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  
      ---- INITIAL POST FROM 2019-05-25 ----
       
    • By d'Hinnisdaël
      Happy new year, everybody 🥬
      I've been sitting on this Dashboard module I made for a client and finally came around to cleaning it up and releasing it to the wider public. This is how it looks.
      ProcessWire Dashboard

      If anyone is interested in trying this out, please go ahead! I'd love to get some feedback on it. If this proves useful and survives some real-world testing, I'll add this to the module directory.
      Download
      You can find the latest release on Github.
      Documentation
      Check out the documentation to get started. This is where you'll find information about included panel types and configuration options.
      Custom Panels
      My goal was to make it really simple to create custom panels. The easiest way to do that is to use the panel type template and have it render a file in your templates folder. This might be enough for 80% of all use cases. For anything more complex (FormBuilder submissions? Comments? Live chat?), you can add new panel types by creating modules that extend the DashboardPanel base class. Check out the documentation on custom panels or take a look at the HelloWorld panel to get started. I'm happy to merge any user-created modules into the main repo if they might be useful to more than a few people.
       Disclaimer
      This is a pre-release version. Please treat it as such — don't install it on production sites. Just making sure 🍇
      Roadmap
      These are the things I'm looking to implement myself at some point. The wishlist is a lot longer, but those are the 80/20 items that I probably won't regret spending time on.
      Improve documentation & add examples ⚙️ Panel types Google Analytics ⚙️ Add new page  🔥 Drafts 🔥 At a glance / Page counter 404s  Layout options Render multiple tabs per panel panel groups with heading and spacing between ✅ panel wrappers as grid item (e.g. stacked notices) ✅ Admin themes support AdminThemeReno and AdminThemeDefault ✅ Shortcuts panel add a table layout with icon, title & summary ✅ Chart panel add default styles for common chart types ✅ load chart data from JS file (currently passed as PHP array) Collection panel support image columns ✅ add buttons: view all & add new ✅
    • By Robin S
      This module is inspired by and similar to the Template Stubs module. The author of that module has not been active in the PW community for several years now and parts of the code for that module didn't make sense to me, so I decided to create my own module. Auto Template Stubs has only been tested with PhpStorm because that is the IDE that I use.
      Auto Template Stubs
      Automatically creates stub files for templates when fields or fieldgroups are saved.
      Stub files are useful if you are using an IDE (e.g. PhpStorm) that provides code assistance - the stub files let the IDE know what fields exist in each template and what data type each field returns. Depending on your IDE's features you get benefits such as code completion for field names as you type, type inference, inspection, documentation, etc.
      Installation
      Install the Auto Template Stubs module.
      Configuration
      You can change the class name prefix setting in the module config if you like. It's good to use a class name prefix because it reduces the chance that the class name will clash with an existing class name.
      The directory path used to store the stub files is configurable.
      There is a checkbox to manually trigger the regeneration of all stub files if needed.
      Usage
      Add a line near the top of each of your template files to tell your IDE what stub class name to associate with the $page variable within the template file. For example, with the default class name prefix you would add the following line at the top of the home.php template file:
      /** @var tpl_home $page */ Now enjoy code completion, etc, in your IDE.

      Adding data types for non-core Fieldtype modules
      The module includes the data types returned by all the core Fieldtype modules. If you want to add data types returned by one or more non-core Fieldtype modules then you can hook the AutoTemplateStubs::getReturnTypes() method. For example, in /site/ready.php:
      // Add data types for some non-core Fieldtype modules $wire->addHookAfter('AutoTemplateStubs::getReturnTypes', function(HookEvent $event) { $extra_types = [ 'FieldtypeDecimal' => 'string', 'FieldtypeLeafletMapMarker' => 'LeafletMapMarker', 'FieldtypeRepeaterMatrix' => 'RepeaterMatrixPageArray', 'FieldtypeTable' => 'TableRows', ]; $event->return = $event->return + $extra_types; }); Credits
      Inspired by and much credit to the Template Stubs module by mindplay.dk.
       
      https://github.com/Toutouwai/AutoTemplateStubs
      https://modules.processwire.com/modules/auto-template-stubs/
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.60
      Composer: rockett/jumplinks
      ⚠️ NOTICE: 1.5.60 is an important security patch-release for an XSS vulnerability discovered by @phlp. It's HIGHLY RECOMMENDED that all Jumplinks users update to the latest version as soon as possible.
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! 🙂
    • By Robin S
      Add Image URLs
      Allows images/files to be added to Image/File fields by pasting URLs.

      Usage
      Install the Add Image URLs module.
      A "Paste URLs" button will be added to all image and file fields. Use the button to show a textarea where URLs may be pasted, one per line. Images/files are added when the page is saved.
       
      https://github.com/Toutouwai/AddImageUrls
      https://modules.processwire.com/modules/add-image-urls/
×
×
  • Create New...