Page 5 of 7

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Sat Apr 25, 2015 5:00 pm
by jult
Harm10 wrote:What option do you use in your browser to get the created XML?

I use Firefox 37.0.2, I pick 'Export Entries Including comments'. Both with and without parsing give the same lack of <br/> tags etc. as output. The browser just prompts me to save the exported .xml, so I do that. Then it is on disk as .xml and I can open it, like you, using Np++.

Harm10 wrote:The screen shot you send shows a lot of html tags like <p> which should be in the generated xml.

Yes, that's why I guess the exporter takes some config value and uses that to omit the <br /> tags. Maybe caching of some sort? I have already tried disabling all the minify and such. To no avail (yet).

original source:
Code: Select all
Nog beschamender eigenlijk.<br /> <br /> Terwijl niemand zich nog bezighoudt met iets anders worden er achter onze ruggen om <a href="http://www.alertnet.org/thenews/newsdesk/N28476184.htm" title="">overal</a>


exported xml:
Code: Select all
Nog beschamender eigenlijk.    Terwijl niemand zich nog bezighoudt met iets anders worden er achter onze ruggen om <a href="http://www.alertnet.org/thenews/newsdesk/N28476184.htm" title="">overal</a>


Why does it export the a href, but not the br ??

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Sat Apr 25, 2015 8:02 pm
by Harm10
The only thing left in my view now is that you try and debug where the breaks are lost.
In the hook file around line 861 you see this code:
Code: Select all
if ($parse != 'no') {
     $content_encoded = parse_intro_or_body($record['introduction']);
     $content_encoded .= parse_intro_or_body($record['body']);
} else {
     $content_encoded = $record['introduction'];
     $content_encoded .= $record['body'];
}
$content_encoded = rawurldecode(html_entity_decode($content_encoded, ENT_QUOTES, "UTF-8"));
// replace CR LF (they can come in with included files)
$content_encoded = preg_replace( "/\r|\n/", " ", $content_encoded );

$repldebug = 'item processing: ' . $record['uid'] . '|' . $record['title'];
$content_encoded = self::contentReplParts($content_encoded, $parse, $repldebug);

If you just comment out the statements from bottom to top and see when the breaks are lost?

Looking at this code it could well be that your breaks are CR LF in stead of <br/> tags?

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Sun Apr 26, 2015 7:32 am
by hansfn
Sorry that I haven't been around to answer this on earlier.

My guess: The standard text processing in PivotX is "XHTML, Convert Linebreaks to <br />" so you don't have HTML break tags in the saved entry text. (You can confirm this be looking in the database.) I see that Harm has found the relevant part of the code in the exporter. If you export without parsing, the output is correct - your line breaks are just removed. However, with parsing, the output is wrong since the line breaks should have been converted to normal HTML linebreaks. I guess the bug is that the call to parse_intro_or_body lacks info about text processing mode.

Replace

Code: Select all
     $content_encoded = parse_intro_or_body($record['introduction']);
     $content_encoded .= parse_intro_or_body($record['body']);

with

Code: Select all
     $content_encoded = parse_intro_or_body($record['introduction'], false, $record['convert_lb']);
     $content_encoded .= parse_intro_or_body($record['body'], false, $record['convert_lb']);

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Tue Apr 28, 2015 9:02 am
by jult
Thanks, hans, that worked.

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Tue Apr 28, 2015 3:16 pm
by Harm10
jult wrote:Thanks, hans, that worked.
@hans: you are going to update the file on sourceforge?

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Wed Apr 29, 2015 6:42 am
by hansfn
I have just updated the file in our SourceForge SVN repository.

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Fri Sep 25, 2015 4:05 pm
by winters
hi hans thanks for all you do and did for pivotx and bolt

As I mentioned on the forum I am switching over to bolt!

Is it possible that importwxr is not up to date in bolt as one of the forum members mentions the same error
viewtopic.php?t=3578&p=19587

as I get during import in bolt
Call to undefined method Bolt\Helpers\String::slug()

error on line 167

thanks!
willem

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Fri Sep 25, 2015 8:32 pm
by hansfn
Hi, Willem

Bob still hasn't released a new version of the importWXR extension. The problems I mentioned earlier in this thread is still present in the current release (1.2.6). Grab the latest code from Github and you should be fine.

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Mon Feb 22, 2016 10:31 pm
by winters
thanks hans/harm,

Bob made the change and I imported the entries however I got a problem with the gallery and
bonus fields, that will not import, did you get that fully working?

I get for example in my xml file:

<wp:meta_value><![CDATA[field_5467c15f00012]]></wp:meta_value>
<!-- Warning! Extrafields key not found! galleryimagelist. Value: 2014-04/okt23_02_04.jpg######
2014-04/okt23_02_08.jpg######
2014-04/okt23_02_12.jpg######
2014-04/okt23_02_03.jpg######
2014-04/okt23_02_02.jpg######
2014-04/kokaneepark.gif######
Extension inactive? Check code to find fields. -->
</wp:postmeta>

could that be a reason for not importing?

thanks

Re: Importing entries and pages from PivotX to Bolt

PostPosted: Mon Feb 22, 2016 10:34 pm
by hansfn
Read https://github.com/bolt/ImportWXR/issues/7

PS! Harm has to explain the warning.