Author:
buzzomatic
Version:
1.1.0
Released:
21 November 2011
Category:
Other, and Workflow

New#13: Fields

I've noticed if the field is not specified to import, when the new entry is created/updated, the field is not populated and stored in the database with/without its default value.

This is causing a problem for a modification I'm nearly finished with which mark's updated entries as yes/no for regular cron jobs. I also had to hack a workaround for setting the date field which isn't really efficient.

The XML feed I'm having to cron is large (5mb) so the other workarounds, e.g. add field with XPath but trigger an XMLImporterHelpers::function to add data, is hitting my memory limit of 512MB.

I'm now investigating fixing this issue for my needs but if you also see this as a limitation others would benefit without I would prefer if an author or contributor could clarify any issues I maybe ignorant of to why this hasn't been implemented before?

Found the ignorance part. On the forum thread (page 4), Nils brought up the issue about all of his fields being reset on XML importer, which wasn't helpful for his project at the time.

I've created a setting on the fields to mark it as inactive, you can then trigger a function on this field without a valid XPath (cuts down on my memory usage).

Mines just a simple returnYes function. So when the importer runs, it returns a yes to be saved in an Updated (extension of checkbox) field.

I've included the Updated field in the module as well as another setting for the XMLImporter, reset Updated field, which requires an 'Updated' field being added to the section. Once added, it will automatically find and reset all values to 'no' before triggering the 'returnYes' function.

I have some issues to address but if anyone else needs the functionality, message me and I'll github them temporarily:

Issues

I would like a returnValue function instead of returnYes - which takes the value from the XPATH field instead. A few problems with this I've yet to understand completely.

Add prepareImportValue function to Updated field.

Needs to be tested in different scenarios - existing content etc.

Use case is for affiliate feeds or other feeds, unlike twitter, where you know when a product/service is inactive until it is no longer available in the feed. The updated entries does part of the job, reduces duplicate entries, but I needed something to highlight which of those entries were new or old.

On a deadline so will come back to this soon depending on your feedback.

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