Search

Thanks, Brendo. That fixed it.

You had me excited for a second or two there…

This extension seems to get in trouble if a section only contains a single field: http://getsymphony.com/download/extensions/issues/view/36867/5/

Hm, after saving an importer all the added fields a gone. Anybody else experiencing this? I’m working on a 2.0.7RC1 install.

I’m on 2.0.6 and I see the same issue!

None of the title/text() placed into the fields are visible and it won’t import any data because of this!

Are you explicitly using 0.1.0, or have you pulled the latest changes from master?

It’d suggest pulling, at least one of the bugs I think I’ve fixed already.

0.1.0 is what I’m using.. how to pull from master though? git is it?

Open up your terminal:

cd extensions/xmlimporter
git checkout master
git pull origin master

If git complains that you have unchecked files, try nano .git/config and switch file mode to false and repeat the pull.

Should do the trick

I’m on a shared hosting and not sure if terminal access is available. can I pull a new extension folder from the master instead? did not see xmlimporter in the master extensions folder through git when browsing.

You can check it out on your machine and upload the files via FTP.

Hm, after saving an importer all the added fields a gone. Anybody else experiencing this? I’m working on a 2.0.7RC1 install.

Hm … Updating to the code currently available in the master branch solves this issue, but I have a new problem:

I’m importing courses from our main university database. It’s a custom XML scheme, no namespace. Saving the importer is just fine - all information saved by the importer manager is correct (field ids etc.). After running my filter I get a nice message that sounds just great:

Import Complete

Import completed successfully: 82 new entries were created, 0 updated, and 0 skipped.

But sadly there are no entries in my section. No error message, only this warning in the logs:

2010/02/02 15:58:35 > WARNING: 2 - call_user_func(xmlimporterwintersemester20092010::getRootExpression) 
[<a href='function.call-user-func'>function.call-user-func</a>]: 
First argument is expected to be a valid callback in file 
/www/htdocs/projekte/nils/infostelle/extensions/xmlimporter/lib/class.xmlimportermanager.php on line 91

I’m not sure what went wrong here. Any ideas?

P. S.: The XML file has a size of around 470 KB - not sure if this may result in memory problems?! Still the import process seems not to abort or fail due to an error - at least nothing is displayed.

@Nils, if you are interested you might check my modified version of Nick’s well-known PHP importer script.

(The good thing is that it builds “slices” of the input array – e.g. corresponding to hundred entries – and posts them to a Symphony page. As far as I remember, I built this version some months ago to import some thousand entries into a section, which did not work with Nick’s original script, trying to send all at once. The downside of the script is: Still there’s no error handling. But it works fine…)

If you want to try it, just drop me a line.

Nils, for now you can essentially comment out that line, I believe it will still work. Hopefully I’ll be able to do something serious about it soon.

@Michael: Thanks! Just sent you a mail.

@Rowan: Do you have an idea why the import might fail? Anything I should try?

I reduced my XML to one element for debugging:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<XmlEventExportPage ExportDatum="02.02.10 15:25:56">
    <Event ID="16289" PageID="29504" Number="31001" SemesterID="39" PeriodStart="26.11.09" RoomID="382">
    </Event>
</XmlEventExportPage>

This is how my importer looks like:

<?php

    require_once(EXTENSIONS . '/xmlimporter/lib/class.xmlimporter.php');

    class XMLImporterWintersemester20092010 extends XMLImporter {
        public function __construct(&$parent) {
            parent::__construct($parent);
        }

        public function about() {
            return array(
                'name'          => 'Wintersemester 2009/2010',
                'author'        => array(
                    'name'          => 'Nils Hörrmann',
                    'website'       => 'http:/blabla.de/infostelle',
                    'email'         => 'nils.hoerrmann@hbk-bs.de'
                ),
                'description'   => 'Importiert Veranstaltungen aus dem HBK-Vorlesungsverzeichnis',
                'file'          => __FILE__,
                'created'       => '2010-01-28T16:31:06+00:00',
                'updated'       => '2010-02-03T09:49:19+00:00'
            );  
        }

        public function options() {
            return array(
                'can-update'        => 'no',
                'fields'            => array (
  0 => 
  array (
    'field' => '65',
    'xpath' => '@Number',
    'php' => '',
  ),
),
                'included-elements' => '/XmlEventExportPage/Event',
                'namespaces'        => NULL,
                'source'            => 'http://blabla.de/infostelle/workspace/xml/semester.xml',
                'section'           => 13,
                'unique-field'      => 0
            );
        }

        public function allowEditorToParse() {
            return true;
        }
    }

?>

Still no luck (but I still get this shiny success message).

Nils, I was experiencing the same issue, but it was related to this commit. Can you confirm that line 279 is commented out in your version?

It’s commented out. So is this good or bad?

So, I’ve been doing some tests:

  1. If I uncomment line 279 ($entry->setDataFromPost($values, $error, false);), the importer will at least create new entries. They are empty.
  2. If I print $value right before that line, I see that all data needed is present, e. g.:

Array ( [nummer] => 31001 [id] => 16289 )

So it seems that something is working as expected when calling $entry->setDataFromPost(). Does anybody know if there have been changes to the entry class that may interfere with this extension?

Okay, I found the problem: the entry data array is properly populated but never committed. So it’s correct that line 279 is commented out as it just populates the data array again. But there should be a call to the commit function around that line. Like this:

$entry->commit();

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details