Possible bug found…
Posted: 16 December 2007 02:48 PM   [ Ignore ]
Member
Avatar
RankRankRank
Total Posts:  51
Joined  2007-07-16

Hi there,

I was having some problems today when using {exp:favorites:save}

I am using the favorites tag on my website, in an ‘events’ section.

Logged in members can visit event information pages, and declare if they are attending or not.
When users tried to attend (i.e: save a favourite), the ‘no entry found’ error was being returned.

The module was failing to get the ID of the url_title with future entries that have numbers in, instead getting the id “2008” from the following URL title:
hamilton_zombie_walk_2008

Entries with numbers in the url_titles and in the past work fine, but future entries with numbers in the url_title were the ones causing problems.

I found the cause of the problem at line 1815 in mod.favorites.php:

if ( preg_match( "/(\d+)/", $qstring, $match ) )
{
  $this
->entry_id = $match['1'];
  
  return
TRUE;
}

...commenting this out has fixed my problem.

If there is a proper fix available, great smile

I hope this is of some help.

Profile
 
 
Posted: 20 December 2007 10:41 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2180
Joined  2006-10-18

Tony,

I can duplicate the problem you’re having.
However, it happens to me both for Future entries and current entries.

I’ll inform the Developers smile

Thank you!

 Signature 
Profile
 
 
Posted: 15 January 2008 12:42 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2180
Joined  2006-10-18

Tony,

This bug has been fixed in the latest release of Favorites 2.1.3

Thank you for your patience. smile

 Signature 
Profile
 
 
Posted: 07 May 2008 02:52 PM   [ Ignore ]   [ # 3 ]
Member
Avatar
RankRankRank
Total Posts:  51
Joined  2007-07-16

Hey guys,

I’ve just come across the same bug - or at least similar.

It’s using 2.1.3 and the url title causing problems is: 40th_anniversary_funk_notld_zombie_crawl - It returns the error for “ID not found”.

Very strange - numbers in the URLs definately cause a problem.

(OK - now I know I dont have the latest version, but seeing as this appeared to be fixed in 2.1.3 (and wasn’t ) - forgive me if I am assuming 2.1.6 won’t solve this - if you could test it first that would be great).

EDIT:

In my 2.1.3, commenting out line 1737 of mod.favourites.php:

/*
    if ( preg_match("#^(\d+)(.*)#", $qstring, $match) )
    {
        
     $seg = ( ! isset($match['2'])) ? '' : $match['2'];
     
     if (substr($seg, 0, 1) == "/" OR $seg == '')
     {
      $this->entry_id = $match['1'];
      $qstring = $REGX->trim_slashes(preg_replace("#^".$match['1']."#", '', $qstring));
     }
     
     return TRUE;
    }
*/

...fixes it.

I never use ID’s in this blog anyway, so that’s OK for me. However, its a bit wonky commenting stuff out like that again wink

Profile
 
 
Posted: 08 May 2008 07:00 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2180
Joined  2006-10-18

Tony,

You’re right about this… well, mostly LOL

The original bug was if there was any number in the URL. We seemed to have fixed that (tested it again).

However, it seems now that ONLY when the URL Title STARTS with a number, it doesn’t work smile

Thanks for spotting this one… I’ll queue it up wink

 Signature 
Profile
 
 
Posted: 08 May 2008 07:02 AM   [ Ignore ]   [ # 5 ]
Member
Avatar
RankRankRank
Total Posts:  51
Joined  2007-07-16

Great, nice one chaps wink

Profile
 
 
Posted: 17 May 2008 08:53 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  10
Joined  2008-04-23

I’ve come across this bug in a different way.  I have a member bookmark area on each page of my website (currently under development so only I can see it online but i’ve attached screen shots).  When viewing a single entry page with a url title that starts with a number the bookmarks (favorites) do not show up, but they show up properly on any other page.

BTW: thanks so much for the modules you’ve developed - they are exactly what we’ve needed for our site!

Image Attachments
Bustler_ schmidt hammer lassen wins competition to design iconic building in Lund, Sweden-1.jpgBustler_ 2008 RAIC National Urban Design Award Winners Announced-1.jpg
Profile
 
 
Posted: 18 May 2008 09:32 AM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  10
Joined  2008-04-23

this bug also occurs when doing a search, and when the random search results code in the URL starts with a number.

Image Attachments
bustlersearchresults-1.jpgbustlersearchresults2-1.jpg
Profile
 
 
Posted: 20 May 2008 07:12 AM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2180
Joined  2006-10-18

Thank you archinect,

This is another known issue smile

As for the search engine results - I’ll take note of this smile

 Signature 
Profile
 
 
Posted: 20 May 2008 05:50 PM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  10
Joined  2008-04-23

i look forward to the fix. 

it would be ideal if you could add a “dynamic=off” parameter, like in the weblog tags, so the currently logged in user can always view his favorites regardless of the url.

Profile
 
 
Posted: 20 May 2008 10:17 PM   [ Ignore ]   [ # 10 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2180
Joined  2006-10-18
archinect - 20 May 2008 05:50 PM

i look forward to the fix. 

it would be ideal if you could add a “dynamic=off” parameter, like in the weblog tags, so the currently logged in user can always view his favorites regardless of the url.

The dynamic="off” parameter should be available to use in the Favorites:Entries loop wink

 Signature 
Profile
 
 
Posted: 20 May 2008 11:24 PM   [ Ignore ]   [ # 11 ]
Newbie
Rank
Total Posts:  10
Joined  2008-04-23

i just tried the dynamic=off parameter but it doesn’t seem to have the effect i’m looking for.  what i would like to do is to show a list of the currently logged in user’s favorites, while viewing another members profile page.  it doesn’t seem like this is possible.  is it?

Profile
 
 
Posted: 21 May 2008 08:15 AM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2180
Joined  2006-10-18

Hmmmm… this could be an issue then…

The dynamic parameter should work, though it seems it doesn’t. I’ll document this and queue it up for the next release. smile

Thank you for your patience…

 Signature 
Profile