0

I have a dexterity content type with custom fields that I have added to the "metadata" tab under portal_catalog.

I have constructed my view template with the following (it is a modfication of folder_listing):

<td tal:content="item/date_request" />
<td tal:content="item/date_due_completed" />
<td tal:content="item/date_completed" />
<td tal:content="item/authorisation_required" />
<td tal:content="item/authorisation_acquired" />
<td tal:content="item/job_status" />

However when I view the folder_listing view I get the following output:

<td>2013-04-30</td>
<td></td>
<td></td>
<td>Yes</td>
<td>Yes</td>
<td>Incomplete</td>

The item/date_due_completed and item/date_completed don't seem to render anything, however the exact same information above for item/date_request renders just fine.

To test this I have modified the view for the content type itself and used context/date_due_completed and context/date_completed and it renders the information fine!

I am very confused as to why I am unable to render the first date field just fine on folder_listing and yet am unable to render the other two.

Has anyone experienced this in the past and is aware of what is going wrong?

EDIT

I have also tried indexing those fields and although in portal_catalog I can now see my content type being indexed for date_due_completed and date_completed the information contained within those fields do not appear on my folder_listing template.

EDIT #2

I have discovered that if you have multiple date fields, all indexed and metadata added, then refer to them in a view template (if the fields were entered with the same date) only one of them will display, is there a work-around to this?

Upon entering different values for each date field my output is as follows:

<td>2013-04-30</td>
<td>2013-05-30</td>
<td>2013-06-30</td>
<td>Yes</td>
<td>Yes</td>
<td>Incomplete</td>
Dan
  • 958
  • 2
  • 11
  • 25
  • 1
    Did you reindex existing objects after adding the metadata specification to the catalog? – SteveM Apr 30 '13 at 19:37
  • I tried reindexing after I had added the metadata, I didn't seem to work at first so I just created a few more objects with my content type and it seemed to start working. I'm guessing it just took a while to index – Dan May 01 '13 at 08:10
  • The symptom for needing reindexing is that old content (created or last edited before the metadata field addition) lacks metadata in the catalog search results. New content would have the metadata. Does that match your experience? – SteveM May 01 '13 at 14:46
  • @SteveM I believe the object I created using my custom content type lacked the metadata for those date fields, I then added the metadata and then edited the content type, added dates to the fields and saved my changes, do you think that would produce this problem? I'm guessing it doesn't reindex the object when you hit save like it does if I was to create a new one from scratch? – Dan May 02 '13 at 09:13
  • Content objects are indexed when saved and reindex when edited. – SteveM May 02 '13 at 15:56

1 Answers1

-1

Sometimes the Zopemonster is a little bit tricky and if one triggers a lot of template errors, especially in macros, the XML Parser seems to hang, but doesn't produce error messages. Shutdown your cluster. Do

for i in `find /path/to/my/plone/ -name *.pyc`; do rm $i; done` 

and restart again. This will cleanup all previously compiled python files. If your bug is persistent after this procedure, ist might be a real bug.

moestly
  • 1,681
  • 15
  • 19