[Zope-CMF] portal_catalog becomes non-functional after copying site

Philip Glaser glaserp@sustainsoft.com
Thu, 14 Nov 2002 18:26:20 -0500


Hi,

I am trying to copy a Plone/CMF site to a different folder, so it has a new
URL. In the copied site, everything seems to work except the portal_catalog.
In the first instance, the catalog will not reindex so as to pick up content
that is located in the new folder hierarchy. It retains the old brains,
instead. If I clear the index, there's just nothing in the index at all, and
nothing gets returned by queries.

So I then tried creating a new Plone site, deleting everything except
portal_catalog, and then copying everything in from the site I want to copy.
That appeared to succeed in the sense that the portal_catalog now reflects
objects in the new hierarchy. However, queries to the catalog don't work.
For example, I have some slots that create content for the home page by
doing a catalog query (on the model of the default Plone site). The continue
to work perfelctly in the existing site. But in the copied site they are
coming up blank -- it would seem the catalog isn't returning anything (even
though the management interface is showing that there are news items in the
catalog). Here's an example of such a slot:

<!-- The news box -->

<table metal:define-macro="newsBox"
       class="box"
       summary="News listing"
       cellpadding="0" cellspacing="0"
       tal:define="results python:request.get('news',
here.portal_catalog.searchResults( meta_type='News Item'

, sort_on='Date'

, sort_order='reverse'

, review_state='published')[:5]);"
       tal:condition="python:test(template.getId()!='recent_news' and
results, 1, 0)">

    <tbody tal:repeat="obj results">

        <tr tal:define="oddrow repeat/obj/odd"
            tal:attributes="class python:test(oddrow, 'even', 'odd')"
            class="#">

            <td colspan="2">

                <a href="#"
                   tal:attributes="href obj/getURL">
                    <span tal:replace="python:test(obj.Title, obj.Title,
obj.id)"> Extended Calendar Product </span></a>:
                    <span tal:replace="python:test(obj.Description,
obj.Description, obj.id)"> Extended Calendar Product </span>
                   (<span tal:replace="python:test(obj.Creator, obj.Creator,
obj.id)"> Author name </span>,
                    <span
tal:replace="python:here.toPortalTime(obj.modified)">Date modified</span>)

            </td>

        </tr>

    </tbody>

</table>





Thanks!


Philip Glaser
Principal and Software Architect
Sustainable Software Solutions, LLC
glaserp@sustainsoft.com
www.sustainsoft.com
973-951-9522