Importing entries and pages from PivotX to Bolt

A forum for Bolt related questions / issues

Re: Importing entries and pages from PivotX to Bolt

Postby jult » Sat Apr 25, 2015 5:00 pm

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 ??
jult
 
Posts: 29
Joined: Sun Jun 05, 2011 9:43 pm

Re: Importing entries and pages from PivotX to Bolt

Postby Harm10 » Sat Apr 25, 2015 8:02 pm

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?
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Importing entries and pages from PivotX to Bolt

Postby hansfn » Sun Apr 26, 2015 7:32 am

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']);
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Importing entries and pages from PivotX to Bolt

Postby jult » Tue Apr 28, 2015 9:02 am

Thanks, hans, that worked.
jult
 
Posts: 29
Joined: Sun Jun 05, 2011 9:43 pm

Re: Importing entries and pages from PivotX to Bolt

Postby Harm10 » Tue Apr 28, 2015 3:16 pm

jult wrote:Thanks, hans, that worked.
@hans: you are going to update the file on sourceforge?
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Importing entries and pages from PivotX to Bolt

Postby hansfn » Wed Apr 29, 2015 6:42 am

I have just updated the file in our SourceForge SVN repository.
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Importing entries and pages from PivotX to Bolt

Postby winters » Fri Sep 25, 2015 4:05 pm

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
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm

Re: Importing entries and pages from PivotX to Bolt

Postby hansfn » Fri Sep 25, 2015 8:32 pm

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.
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Importing entries and pages from PivotX to Bolt

Postby winters » Mon Feb 22, 2016 10:31 pm

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
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm

Re: Importing entries and pages from PivotX to Bolt

Postby hansfn » Mon Feb 22, 2016 10:34 pm

Read https://github.com/bolt/ImportWXR/issues/7

PS! Harm has to explain the warning.
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

PreviousNext

Return to Bolt Discussion

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron