backdrop-contrib / xmlsitemap

Provides a sitemap that conforms to the sitemaps.org specification.
GNU General Public License v2.0
1 stars 12 forks source link

xmlsitemap taxonomy module still joins to non-existant vocabulary table #94

Closed jenlampton closed 4 years ago

jenlampton commented 4 years ago

In the xmlsitemap_taxonomy_xmlsitemap_index_links() function, there is a database query that still tries to join to the taxonomy_vocabulary table, but that table has been removed from Backdrop. Vocabulary info is now stored in config.

Line 66:

    $tids = db_query_range("SELECT t.tid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_vocabulary} tv USING (vocabulary) LEFT JOIN {xmlsitemap} x ON x.type = 'taxonomy_term' AND t.tid = x.id WHERE x.id IS NULL AND tv.machine_name IN (:bundles) ORDER BY t.tid DESC", 0, $limit, array(':bundles' => $bundles))->fetchCol();

should maybe be something more like this?

$tids = db_query_range("SELECT t.tid
      FROM {taxonomy_term_data} t
      LEFT JOIN {xmlsitemap} x ON x.type = 'taxonomy_term' AND t.tid = x.id
      WHERE x.id IS NULL
        AND t.vocabulary IN (:bundles)
      ORDER BY t.tid
      DESC", 0, $limit, array(':bundles' => $bundles))->fetchCol();
jenlampton commented 4 years ago

Oh, this seems to be done in HEAD already. Not sure how I missed that.. sorry for the noise. closing.