FBGallery

Hello,

I am trying to use the FBGallery extension but am getting the following error :

Anyone encountered this and found a solution?


Undefined index: id


...\protected\extensions\FBGallery\FBGallery.php(184)




Regards

Probably you should add pid number, eg:


$this->widget('application.extensions.FBGallery.FBGallery', array('pid'=>'1'));

I’ve got problem with latest framework version: 1.1.7. When I use 1.1.4 everything is ok, but when I use 1.1.7 I get some JQuery error:


Error: uncaught exception: Syntax error, unrecognized expression: [rel=page.pl - Home-1]

It’s something that is shown by Firefox Console.

Any tips?

Ok, I did a new test. I used to have the problem on a static page, using




 $this->widget('application.extensions.FBGallery.FBGallery', array('pid'=>'1'));

which still gets me the same error

Now, I tried on a id dependant page (for example, the post view page in the blog demo), and I use




 $this->widget('application.extensions.FBGallery.FBGallery');

I now get the following error :




Trying to get property of non-object


...

\www\blog\protected\extensions\FBGallery\FBGallery.php(201)

...



Any ideas on both issues anyone? :)

PS : this has been happening with Yii 1.1.6 and 1.1.7, using PHP 5.3.5 or 5.2.17

For insure: have you got database tables for gallery with correct configuration inside?

Maybe you have got incorrect: login, pass, database name, host?

Thanks for your input, unfortunately, yes, I set up the tables for gallery, and the application has no trouble with accessing database elements so I’m guessing my settings are correct ;)

Hi, i have a same problem.

my database settings are correct too.

Any ideas for this issue? ???

Hi, i have a same problem.

my database settings are correct too and there is no data in tbl_galleries.

Any ideas for this issue? ???

And I’m having same problem :)

Hi,

Change this line in FBGallery.php

//$pid = $_GET["id"];

$pid = @$_GET[‘id’];

Thanks,

When you have "unrecognized expression", open FBGallery.php file and find the line

$rel = preg_replace(’!\-+!’, ‘-’, preg_replace("/[^a-z0-9-_.]/", “-”, strtolower($this->pageTitle)));

and change with the following:





$test_mm=str_replace('.','_',$this->pageTitle);

$rel = preg_replace('!\-+!', '-', preg_replace("/[^a-z0-9-_.]/", "-", strtolower($test_mm)));



Your problem is a dot in the title.

I realize this is an old topic but he was absolutely correct. The fix is found on lines: 432-437


protected function getRelTag()

	{

		$test_mm=str_replace('.','_',$this->pageTitle);

		return preg_replace('!\-+!', '-', preg_replace("/[^a-z0-9-_.]/", "-", strtolower($test_mm)));

		//return preg_replace('!\-+!', '-', preg_replace("/[^a-z0-9-_.]/", "-", strtolower($this->getPageTitle())));

	}

That will fix the problem