backdrop-contrib / shopify

Integrate and sync your site with a Shopify store.
GNU General Public License v2.0
0 stars 1 forks source link

Infinite loop #18

Open laryn opened 2 years ago

laryn commented 2 years ago

Noted by @argiepiano in shopify_taxonomy_term_view():

  // The code below creates an infinite loop and breaks the site. Basically, when a taxonomy term is viewed,
  // it invokes backdrop_goto to display the taxonomy term (again and again...) (?)

  // switch ($term->vocabulary_machine_name) {
  //   case 'shopify_collections':
  //     $uri = entity_uri('taxonomy_term', $term);
  //     backdrop_goto($uri['path']);
  //     break;
  //   case 'shopify_tags':
  //     $uri = entity_uri('taxonomy_term', $term);
  //     backdrop_goto($uri['path']);
  //     break;
  // }
argiepiano commented 2 years ago

One more note here. vocabulary_machine_name doesn't exist in Backdrop's Taxonomy Terms. The correct property is vocabulary.

Thus, if you keep vocabulary_machine_name in the switch statement, the infinity loop is not triggered (b/c vocabulary_machine_name doesn't exist and is never matched in the case.

To generate the infinite loop you have to change that to the correct property, vocabulary - and then the site breaks.

laryn commented 2 years ago

I'm trying to figure out the purpose here -- I'm guessing that the default term page doesn't work because the Shopify entities won't show up like regular nodes do, so it's supposed to redirect to a different page where the Shopify entities show up.