#304 ✓resolved
Nigel Stanger

Can't bulk import values for inherited topic type fields

Reported by Nigel Stanger | December 15th, 2011 @ 06:21 PM | in 1.3 (closed)

If you add an extended field like "Categories" to the top-level "Topic" topic type, that field is inherited by all of its child topic types. However, if you try to import a file containing, let's say, "Place" topics, the values for the "Categories" field are not imported and the field shows as empty in the imported records. If you move the "Categories" field from "Topic" to "Place", the import works correctly.

I've only tried this with the "Topic" topic type and it's immediate children, i.e., I haven't tried creating a child of "Place" and seeing whether the problem occurs there. However, given that the same problem occurs even when you import the items as "Topic" rather than "Place", that seems to imply that the problem is with the "Topic" topic type rather than a problem with field inheritance in general.

I have tried it with two different extended fields, and the behaviour is the same in both cases.

Comments and changes to this ticket

  • Walter McGinnis

    Walter McGinnis December 15th, 2011 @ 08:44 PM

    • Tag set to simple importers, extended_fields, importer
    • Milestone set to 1.3
    • State changed from “new” to “open”
    • Assigned user set to “Kete”
    • Milestone order changed from “1” to “0”


    Unfortunately the importers functionality for Kete is one of our weakest areas of automated testing. So I'll need to rely on you for some manual testing help.

    I think I found the subtle bug that is root of the problem. A single character change to a file.

    Can you change line 973 in lib/importer.rb from

    if ancestors.size > 1


    if ancestors.size > 0

    and save the file and run your import and see if that fixes the problem, please?

  • Walter McGinnis

    Walter McGinnis December 15th, 2011 @ 08:48 PM

    Just a quick note. Not only will you need to change this file, but you'll need to restart the backgroundrb process. You'll need to run the following from your application's root directory:

    console script/backgroundrb stop

    and then

    console script/backgroundrb start

    After that you can run your import.

  • Nigel Stanger

    Nigel Stanger December 16th, 2011 @ 09:46 AM

    Yes! It now works as expected. Got to hate those off-by-one bugs :).

  • Walter McGinnis

    Walter McGinnis December 16th, 2011 @ 10:04 AM

    • State changed from “open” to “resolved”

    Great, glad to hear that did the trick!

    Thanks for reporting the bug and helping test the fix.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Kete was developed by Horowhenua Library Trust and Katipo Communications Ltd. to build a digital library of Horowhenua material.

People watching this ticket