# Import\_export patches for user errors (and extensions)

**URL:** <https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862>\
**Category:** Radiant CMS\
**Created:** [September 5, 2007, 6:28pm UTC](https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862 "2007-09-05T18:28:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 5, 2007, 6:28pm UTC](https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862/1 "2007-09-05T18:28:25Z")

</div>

Since this is the second time this week someone had problems with the  
import\_export extension, I will post my patches.

Use them at your own risk, they have been tested only by Andrea F.,  
Will G. and me. I won’t post them to the dev site until I have the  
time to really look into them and clean 'em up.

Good luck,  
Giovanni 🙂

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 6, 2007, 5:24am UTC](https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862/2 "2007-09-06T05:24:49Z")

</div>

After closer inspection, it appears that the applied patches are causing  
my page\_attachments to be neither exported nor imported (probably  
because they aren’t exported!).

Giovanni, since you added a priority field to the extension\_meta table,  
must I now assign a priority to each extension in order for them to be  
processed at all?

–  
Will G.

Find out why this email is 5 sentences or less at [http://five.sentec.es/](http://five.sentec.es/)

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 6, 2007, 8:32am UTC](https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862/3 "2007-09-06T08:32:01Z")

</div>

Disregard this. I needed to alter  
vendor/extensions/import\_export/lib/exporter.rb, line 3, to specify  
which models to export. After adding PageAttachment to the end of the  
list (there has _got_ to be a better, more Rails-esque way to do this),  
my page\_attachment records are now exported.

I have yet to try importing with this fix in place, though.

Will G. wrote:

> After closer inspection, it appears that the applied patches are causing  
> my page\_attachments to be neither exported nor imported (probably  
> because they aren’t exported!).
> 
> Giovanni, since you added a priority field to the extension\_meta table,  
> must I now assign a priority to each extension in order for them to be  
> processed at all?

–  
Will G.

Find out why this email is 5 sentences or less at [http://five.sentec.es/](http://five.sentec.es/)

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 6, 2007, 9:11am UTC](https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862/4 "2007-09-06T09:11:06Z")

</div>

Import-Export exports only the default rails models. I didn’t change  
that because the production version of my app has already lots of data  
stored in the extensions tables and I don’t want to touch it when I  
update (importing new version of pages, snippets and stuff).

2007/9/6, Will G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 6, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862/5 "2007-09-06T16:12:12Z")

</div>

IIRC, I left open a hook to add your own models. I didn’t put this hook  
in page\_attachments because I couldn’t be sure anyone was going to use  
import\_export. Also consider that import\_export is half-baked, too.  
I’m of a mind to rewrite it as Rake tasks with dependencies.

Sean

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 6, 2007, 4:19pm UTC](https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862/6 "2007-09-06T16:19:13Z")

</div>

2007/9/6, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I’m of a mind to rewrite it as Rake tasks with dependencies.

That would be great Sean.

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 7, 2007, 1:29am UTC](https://www.ruby-forum.com/t/import-export-patches-for-user-errors-and-extensions/113862/7 "2007-09-07T01:29:35Z")

</div>

Agreed! Sean, please be of a full mind! 😉

I’d be happy to be a guinea pig.

Giovanni I. wrote:

> 2007/9/6, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > I’m of a mind to rewrite it as Rake tasks with dependencies.
> 
> That would be great Sean.

–  
Will G.

Find out why this email is 5 sentences or less at [http://five.sentec.es/](http://five.sentec.es/)
