Home › Forums › Calendar Products › Events Calendar PRO › Week and Photo view links always include term with term_id == 1
- This topic has 8 replies, 3 voices, and was last updated 11 years, 9 months ago by
Leah.
-
AuthorPosts
-
June 9, 2014 at 4:55 pm #215674
robertde
ParticipantHi. There is a bug in version 3.6 of The Events Calendar Pro such that if the term with term_id=1 is in the Events taxonomy, then the urls generated by the Pro plugin, i.e. the Week and Photo urls, include that term if no other term is specified.
Both functions tribe_get_week_permalink( $week = null, $term = true ) and tribe_get_photo_permalink( $term = true ) have $term default to true. They pass $term to TribeEvents::instance()->getLink(). getLink() forces the Boolean true to (int) 1 when it calls WordPress’s get_term_link:
$term_link = get_term_link( (int) $term, self::TAXONOMY );
This results in adding the term with term_id = 1 to the url if it is in the events taxonomy.
I’m not sure if the fix is to have $term default to false or null, or to code tribe_get_week_permalink() and tribe_get_photo_permalink() the way, e.g., function tribe_get_gridview_link($term = null) is coded. If you could tell me what the right way to fix this is, I can patch our plugin until such time as you release a fix (which I hope will be in the next release).
Thanks!
June 10, 2014 at 7:13 am #216777Brook
ParticipantHowdy robertde,
I am unable to reproduce this, try as I might. My code is as follows:
add_action('wp_footer', 'test_func'); function test_func ($wp_query) { echo tribe_get_week_permalink('2014-5-6'); }Would you mind providing your code so that I can better reproduce the problem? Also, what page are you attempting this on? That page’s functionality varies based on the current page.
I hope that we can fix this in the next release as well! Realistically though we are not always able to do that. We have to gauge how many people the bug impacts, and the severity of that impact, then compare that with other bugs/feature requests. Since this bug has so far only affected one person, it might not make it into the next release. I hope you understand that. However, if we are able to isolate it as a bug and reproduce it on our systems it most certainyl will be fixed, I just can not say when right now.
Thanks for reporting this! Please give me some example code if you do not mind so that I can reproduce it. Also, can you let me know what version of PHP you are running? Thank you!
– Brook
June 10, 2014 at 1:35 pm #217286robertde
ParticipantHi, Brook. Sorry I wasn’t clearer in my description. I don’t have any custom code. I’m reporting a bug in your Events Pro code.
To reproduce the problem:
- Figure out what term in any of your taxonomies has term_id = 1. You can search the database for this if you want: `SELECT * FROM wp_terms WHERE term_id = 1;`
- Add that term to your Event categories.
- Visit your main Events page.
- Select either the Week view or the Photo view. Notice that the page you land on is limited to the category with term_id = 1.
The initial report describes where in your code this bug is triggered. I realize now I should’ve provided some context for my report, i.e. what the symptoms are on the front end. Hopefully the steps to reproduce above will help. I’m hoping since I’ve pointed you straight to the code that causes the bug it should be quick and easy enough to fix that it might make it into your next release. But I understand if no one else has reported it, it might be a lower priority for you.
Thanks for your swift reply! Let me know if you need further info.
June 10, 2014 at 1:45 pm #217294robertde
ParticipantSorry about the weird formatting in the SQL above. Apparently the backticks that SQL uses to contain table and column names are interpreted as code markers in text posted here. The backticks aren’t really necessary in this case. The correct SQL is:
SELECT * FROM wp_terms WHERE term_id = 1;June 10, 2014 at 2:13 pm #217335Brook
ParticipantAhh thank you for the extra explanation Robertde. I can now reproduce the problem. I tried simply changing $term’s default to null, and that made it work properly for me. Although, this “fix” has very little testing so far.
I am reporting this to our devs straight away. They can investigate a proper fix and release it with one of our upcoming maintenance builds. Thank you again for everything involved in reporting this! A member of the Tribe support staff will update this topic once a patch for this has been integrated into our code and is about to be released.
– Brook
June 10, 2014 at 3:58 pm #217506robertde
ParticipantGlad you’re able to reproduce, Brook. Thanks for passing the issue along to development. I look forward to a fix in an upcoming release.
June 10, 2014 at 10:39 pm #218091Brook
ParticipantYou are very welcome!
– Brook
June 12, 2014 at 1:55 pm #221451Brook
ParticipantBy the way, if you have a minute or two, we would love it if you could write a few words about the plugin here. Thanks!
– Brook
July 17, 2014 at 6:01 pm #434682Leah
MemberHi there,
I just wanted to drop in and update you on the status of this issue. We are working on a fix, but we were not able to include it in our upcoming release (3.7). Correcting this problem is still important to us and we hope to have a fix done for a future maintenance release. We will do our best to keep you updated here on our progress. Thank you for your patience and understanding while we work on this.
Best,
Leah -
AuthorPosts
- The topic ‘Week and Photo view links always include term with term_id == 1’ is closed to new replies.
