Re: Gallery3 search
Bharat Mediratta <[email protected]> Thu, 7 Feb 2013 12:05:02 -0800
| Newsgroups | gmane.comp.web.gallery.devel |
|---|---|
| Message-ID | <CAESa+_mXq5PjQpLFrZcihu7+1_kUVjOtmAXDv-qdEZDBEjLXvQ@mail.gmail.com> |
Ok, my guess is that you're using PHP 5.3 which doesn't support array
indices on function returns. Comparison below. I'll fix.
-----
$ php -v && php -r 'function foo() { return array(1,2,3); } print
foo()[1];'
PHP 5.3.10-1ubuntu3.5 with Suhosin-Patch (cli) (built: Jan 18 2013
23:40:19)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
PHP Parse error: syntax error, unexpected '[' in Command line code on line
1
vs.
$ php -v && php -r 'function foo() { return array(1,2,3); } print
foo()[1];'
PHP 5.4.4-10 (cli) (built: Nov 24 2012 12:48:13)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
2
On Wed, Feb 6, 2013 at 3:43 PM, Dave Moore <[email protected]> wrote:
> Upgraded to build 329 and did a search for an item that has only one
> result:
>
> 2013-02-06 23:33:55 +00:00 --- error: Kohana_PHP_Exception [ 4 ]: syntax
> error, unexpected '['
>
> /home/gallery2ca/
> gallery2.ca/gallery3/modules/search/controllers/search.php [ 114 ]
> #0 /home/gallery2ca/gallery2.ca/gallery3/system/core/Event.php(208):
> Kohana_PHP_Exception_Core::shutdown_handler(NULL)
> #1 /home/gallery2ca/gallery2.ca/gallery3/system/core/Kohana.php(553):
> Event_Core::run(Array, Array)
> #2 [internal function]: Kohana_Core::shutdown('system.shutdown')
> #3 {main}
>
> and one that has more that 100 results, I get the same error.
>
> Dave
>
>
> On 2013/February/06 11:50 AM, Bharat Mediratta wrote:
>
>
> Can you send me your stack trace with the latest code? thanks.
>
>
> On Tue, Feb 5, 2013 at 7:19 PM, Dave Moore <[email protected]> wrote:
>
>> Tried build 327 with your commit for ticket 1990. Still same result.
>> Another user has the issue as well:
>> http://galleryproject.org/node/110858
>>
>> removing the [0] from controllers/search.php
>>
>>
>> return search::search_within_album(search::add_query_terms($q), $album, 1000, 1)[0];
>>
>> Seems to have fixed it for me. I'm running:
>> PHP: 5.3.18-pl0-gentoo
>> the other user is running:
>> PHP 5.3.10-1ubuntu3.5
>>
>> hope that point to the right direction. Arrays make my brain hurt :-)
>>
>> Dave
>>
>>
>> On 2013/February/05 12:41 PM, Bharat Mediratta wrote:
>>
>>
>> Can you try with the latest 3.0.x branch and let me know if you still see
>> the problem?
>>
>>
>> On Tue, Feb 5, 2013 at 10:03 AM, Bharat Mediratta <[email protected]>wrote:
>>
>>>
>>> What version of PHP are you using? We're using a construct there like
>>> this:
>>>
>>> foo(...)[1]
>>>
>>> Where foo(...) always returns an array and we grab the first element.
>>> I know this didn't work in PHP4 but I assumed that it always worked in PHP5.
>>>
>>> I did find another error while I was in there and fixed it (#1990)
>>>
>>>
>>> On Mon, Feb 4, 2013 at 5:41 PM, Dave Moore <[email protected]> wrote:
>>>
>>>> On a fresh install it seems to work but on a upgraded install it
>>>> seems to fail with this error:
>>>>
>>>> 2013-02-05 01:30:09 +00:00 --- error: Kohana_PHP_Exception [ 4 ]:
>>>> syntax error, unexpected '['
>>>> /home/gallery2ca/
>>>> gallery2.ca/gallery3/modules/search/controllers/search.php [ 114 ]
>>>> #0 /home/gallery2ca/gallery2.ca/gallery3/system/core/Event.php(208)<http://gallery2.ca/gallery3/system/core/Event.php%28208%29>:
>>>> Kohana_PHP_Exception_Core::shutdown_handler(NULL)
>>>> #1 /home/gallery2ca/gallery2.ca/gallery3/system/core/Kohana.php(553)<http://gallery2.ca/gallery3/system/core/Kohana.php%28553%29>:
>>>> Event_Core::run(Array, Array)
>>>> #2 [internal function]: Kohana_Core::shutdown('system.shutdown')
>>>> #3 {main}
>>>>
>>>> A clue perhaps:
>>>> https://github.com/gallery/gallery3/commit/1e4d75c12072b49c3469f18af13bcf3439afc6b0
>>>> Perhaps there is some old files about or I did not follow the upgrade
>>>> directions to the tee.
>>>>
>>>> Dave
>>>>
>>>>
>>>> On 2013/February/04 12:18 PM, Bharat Mediratta wrote:
>>>>
>>>> +gallery-devel
>>>>
>>>> Can you give me a stack trace from your logs? I can't reproduce the
>>>> problem.
>>>>
>>>>
>>>> On Mon, Feb 4, 2013 at 9:29 AM, David Moore <
>>>> David.Moore-ylUoi/[email protected]> wrote:
>>>>
>>>>> In build 323 of G3 the search function returns a 500 error.
>>>>>
>>>>>
>>>>>
>>>>> I thought that since you are going to release 3.05 soon that it might
>>>>> need some investigation.
>>>>>
>>>>> I would have posted to the –core mailing list but the IT department
>>>>> here is blocking more and more content and SF is one of them. L I
>>>>> also can’t use my personal webmail either.
>>>>>
>>>>>
>>>>>
>>>>> Cheers!
>>>>>
>>>>>
>>>>>
>>>>> <http://www.eastlink.ca/>
>>>>>
>>>>> *
>>>>> **David Moore
>>>>> Network Specialist*
>>>>> Telephone
>>>>> Eastlink
>>>>> #3 - 1004 Parsons Rd SW | Edmonton, AB T6X 0J4
>>>>> David.Moore-ylUoi/[email protected] <%20David.Moore-ylUoi/[email protected]> *M:
>>>>> *780.902.7394
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Everyone hates slow websites. So do we.
>>>> Make your web apps faster with AppDynamics
>>>> Download AppDynamics Lite for free today:http://p.sf.net/sfu/appdyn_d2d_jan
>>>>
>>>>
>>>>
>>>> __[ g a l l e r y - d e v e l ]_________________________
>>>>
>>>> [ list info/archive --> http://gallery.sf.net/lists.php ]
>>>> [ gallery info/FAQ/download --> http://gallery.sf.net ]
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Free Next-Gen Firewall Hardware Offer
>>>> Buy your Sophos next-gen firewall before the end March 2013
>>>> and get the hardware for free! Learn more.
>>>> http://p.sf.net/sfu/sophos-d2d-feb
>>>>
>>>> __[ g a l l e r y - d e v e l ]_________________________
>>>>
>>>> [ list info/archive --> http://gallery.sf.net/lists.php ]
>>>> [ gallery info/FAQ/download --> http://gallery.sf.net ]
>>>>
>>>
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Free Next-Gen Firewall Hardware Offer
>> Buy your Sophos next-gen firewall before the end March 2013
>> and get the hardware for free! Learn more.
>> http://p.sf.net/sfu/sophos-d2d-feb
>> __[ g a l l e r y - d e v e l ]_________________________
>>
>> [ list info/archive --> http://gallery.sf.net/lists.php ]
>> [ gallery info/FAQ/download --> http://gallery.sf.net ]
>>
>
>
>
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
__[ g a l l e r y - d e v e l ]_________________________
[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]
(unnamed)
(image/png, 13.9 KB) - not displayed