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:  1318
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:  1318
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:  1318
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