Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.


If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping


Answers may be delayed for posts that do not include sufficient information.

Pawtucket default theme fails in browse terms.

Hello

I have added a ca_items_list to my ca_objects in providence.

I have 2 objects in database. I have 2 words in vocabulary and i have associated one word for each object.

Now, in browse screen i can see the vocabulary terms associated to my objects, as you can see in the screen1, i have the 2 words with one object associated image.

When i click in one word, i have this result screen:

As you can see, in the one term search result I have 2 objects, not one.

It is like the facet_term filter is not works propierty.

Any idea?

Comments

  • I have been reading the code looking for this problem.

    I have found this select in the ./app/lib/ca/Browse/BrowseEngine.php file at line 1766

    ` if ($vn_i == 0) {
    $vs_sql = "
    SELECT ".$this->ops_browse_table_name.'.'.$t_item->primaryKey()."
    FROM ".$this->ops_browse_table_name."
    {$vs_relative_to_join}
    {$vs_join_sql}
    WHERE
    {$vs_get_item_sql}
    {$vs_where_sql}";

                      $qr_res = $this->opo_db->query($vs_sql, $va_sql_params);
                    } else {
                      $vs_sql = "
                        SELECT ".$this->ops_browse_table_name.'.'.$t_item->primaryKey()."
                        FROM ".$this->ops_browse_table_name."
                        {$vs_relative_to_join}
                        {$vs_join_sql}
                        WHERE
                          {$vs_get_item_sql}
                          {$vs_where_sql}";
    
                      $qr_res = $this->opo_db->query($vs_sql, $va_sql_params);
    
                    }
    

    `
    It is a conditional (if) with an identical else code. If I "echo" the select i see this in my browse screen:

    SELECT ca_objects.object_id FROM ca_objects INNER JOIN ca_objects_x_vocabulary_terms ON ca_objects.object_id = ca_objects_x_vocabulary_terms.object_id INNER JOIN ca_list_items ON ca_objects_x_vocabulary_terms.item_id = ca_list_items.item_id WHERE (ca_list_items.hier_left >= 21475.80211527900000000000 AND ca_list_items.hier_right <= 25770.75223042700000000000 AND ca_list_items.list_id = 48)

    As you can see the pawtucket search for this condition (a_list_items.hier_left >= 21475.80211527900000000000 AND ca_list_items.hier_right <= 25770.75223042700000000000 AND ca_list_items.list_id = 48).

    hier_right and hier_left are hierarchical indexes that help (or used to help) building the hierarchy tree faster; i.e. figuring out parents, children, siblings, etc. They're generated automatically and you shouldn't touch them. The problem is that in the ca_list_items database all the records has the same a_list_items.hier_left and a_list_items.hier_right values.... so, the select allways returns all the objets (instead return the objects associated to a concrete vocabulary item).

  • Ok, I think that this is not a pawtucket bug.

    I am thinking that probably another software developer of my company has insert all the vocabulary fields in the database directly with the same hier_left fields in all the records....

    :(

    I dont know if Pawtucket can rewrite all the hier_left fields automatically

  • In Providence, under Manage > Administration > Maintenance, there is an option to Rebuild hierarchical indexes. Give that a try.

Sign In or Register to comment.