2

Just upgraded a site from EE 2.5 something to 2.7.2 it is running MSM all the subsites pull content from the main site. Each subsite has no content or categories of its own. (This is the way I inherited it) When I did the update I also updated low seg2cat from 2.6.1 to 2.8.0 The code below is a template in a subsite and it used to work just fine.

{if "{segment_1_category_id}" != ""}
  {exp:channel:entries channel="channel_name" site="site_name" category_group="11" category="{segment_1_category_id}" status="top_page"}
    <h2>{if long_title}{long_title}{if:else}{title}{/if}</h2>
{if article_img}<div class="article_img" style="width:{article_img_width}px">{if article_source}<a href="{article_source}">{/if}{if article_img_link}<a href="{article_img_link}">{/if}{article_img wrap="image"}{if article_img_link}</a>{/if}{if article_source}</a>{/if}<br/><p class="caption">{article_img_caption}</p></div>{/if}
    {body}
{if more_info}<hr style="border-top: 2px dotted #555; background:none;" /><h3>For more information:</h3>{more_info}{/if}
    <p><em>Tagged with: {exp:tag:tags entry_id="{entry_id}" type="weblog" site="sitenames" backspace="2" orderby="clicks" sort="desc" limit="10"}<a href="http://earthworksaction.org/tags/tag_entries/tag/{websafe_tag}" title="{tag}">{tag}</a>, {/exp:tag:tags}</em></p>
    {embed="site_name:includes/fb-twitter"}
  {/exp:channel:entries}
{/if}

Now {segment_1_category_id} returns nothing. I rolled back the seg2cat version to 2.6.1 and then it produces the proper output. Only problem is it also creates php errors even though everything seems to work anyways. This is the error

Severity: Warning

Message: call_user_func_array() expects parameter 1 to be a valid callback, class 'Low_seg2cat_ext' does not have a method 'template_fetch_template'

Filename: libraries/Extensions.php

Any suggestions on a solution? I have a feeling it is now treating categories as site specific and because the subsite has no categories and technically it is referencing a category from the main site it is not returning anything.

4

Low Seg2Cat has always been site specific. However, some have made a slight alteration to the extension file to search through all sites. To do this in the latest version, comment out (or remove) line 218 of ext.low_seg2cat.php, which reads:

->where('site_id', $this->site_id)

Also make sure the Category Groups setting is set to --All--.

The call_user_func_array error you mentioned is a result of the rollback. The new version added another hook/method to call. The old version doesn't contain the newly inserted method reference. Just use the new version with the above hack to allow for cross-site matching.

2
  • Awesome response time! Had to also do the same on line 427 but this pointed me in the correct direction. Thanks so much. Great support for a free addon. Off to look for the donate button on your site.
    – Phil
    Oct 27 '13 at 21:26
  • Seconded, Phil. And thanks for the line 427 steer too. Off to donate also. Feb 13 '14 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.