Announcement

#1 2014-01-22 05:16:00

coolsun19
Member
2014-01-22
6

Unable to refresh albums list on Piwigo iOS

Hi Folks,
I'm using Piwigo 2.6.0. and its iOS latest version. My problem is that I'm not able to refresh albums list on iOS. The only Album it shows on iOS is "undefined", which doesn't match my albums list on the web.
How can I fix it? I need your help.
Thanks a lot!

Offline

 

#2 2014-01-22 07:52:55

flop25
Piwigo Team
2006-07-06
6839

Re: Unable to refresh albums list on Piwigo iOS

Hello
is that in the public part? What changed recently on the gallery? Try to disable plugins If you did the upload recently, re-upload files by overwriting by Ftp


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2014-01-23 03:14:47

coolsun19
Member
2014-01-22
6

Re: Unable to refresh albums list on Piwigo iOS

Hi flop25,
I've reinstalled piwigo 2.6.0 by ftp, and I haven't made any changes. The problem is still there.

Offline

 

#4 2014-01-23 08:38:11

flop25
Piwigo Team
2006-07-06
6839

Re: Unable to refresh albums list on Piwigo iOS

Great but could you also answer me Thx
and test disabling plugins too


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2014-01-24 06:06:41

coolsun19
Member
2014-01-22
6

Re: Unable to refresh albums list on Piwigo iOS

my galary is on http://fanta.shaoyimin.com
I disabled all plugins, but nothing changes.
thanks!

Offline

 

#6 2014-01-24 09:52:00

rickx123456
Guest

Re: Unable to refresh albums list on Piwigo iOS

Hello all,
I have a clean install of 2.6, I have not added any plugins, templates, nothing only a clean 2.6 (yesterday)... I am using PHP: 5.4.21... my phone is iPhone 4, the iPhone app is not working correctly, no albums are appearing, only ----- and undefined, if I do add a folder is does add to the root folders, but it still does not appear on the iPhone app.  any idea's?  Also, this app worked before I did made a clean install of 2.6

 

#7 2014-01-24 10:09:03

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13174

Re: Unable to refresh albums list on Piwigo iOS

coolsun19 wrote:

my galary is on http://fanta.shaoyimin.com
I disabled all plugins, but nothing changes.
thanks!

I have registered on your Piwigo as "plg". Can you give me "administrator" status on [Administration > Users > Manage] so that I can test? If not, please tell us your version of PHP.


Latest blog post (May 3rd 2018) New subscription form

Offline

 

#8 2014-01-24 10:32:47

flop25
Piwigo Team
2006-07-06
6839

Re: Unable to refresh albums list on Piwigo iOS

rickx123456 wrote:

Hello all,
I have a clean install of 2.6, I have not added any plugins, templates, nothing only a clean 2.6 (yesterday)... I am using PHP: 5.4.21... my phone is iPhone 4, the iPhone app is not working correctly, no albums are appearing, only ----- and undefined, if I do add a folder is does add to the root folders, but it still does not appear on the iPhone app.  any idea's?  Also, this app worked before I did made a clean install of 2.6

please open a new thread and post a link to your galery please


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#9 2014-01-24 10:36:14

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13174

Re: Unable to refresh albums list on Piwigo iOS

It looks like the same problem, I have asked rickx123456 to give details on this very topic :-)


Latest blog post (May 3rd 2018) New subscription form

Offline

 

#10 2014-01-24 10:42:10

rickx123456
Guest

Re: Unable to refresh albums list on Piwigo iOS

Hello again, the website  is http://superholky.com

All folders require login
Thank you for your assistance!
Rick

 

#11 2014-01-24 10:43:02

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13174

Re: Unable to refresh albums list on Piwigo iOS

The good news is that I reproduce the problem with my own iphone. Let's investigate now!


Latest blog post (May 3rd 2018) New subscription form

Offline

 

#12 2014-01-24 10:45:33

rickx123456
Guest

Re: Unable to refresh albums list on Piwigo iOS

Hello again,
I am happy to give you a admin login if you need one (send me an email and I will respond), there is nothing overly sensitive on the site.
Thanks,
Rick

 

#13 2014-01-24 11:49:40

coolsun19
Member
2014-01-22
6

Re: Unable to refresh albums list on Piwigo iOS

hello plg,
I just updated your account to administrator.
Excited to have your help. Thanks!

Offline

 

#14 2014-01-24 13:48:05

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13174

Re: Unable to refresh albums list on Piwigo iOS

rvelices, I've found the problem. It is related to [Subversion] r22729. The output of pwg.categories.getList was modified if tree_output=true. Actually you fixed a bug because in Piwigo 2.5, when using tree_output=true, the "categories" key was missing in the output. Unfortunately the mobile application (and maybe others) have been built with this this output.

To sum up, in Piwigo 2.5:

$ perl tools/piwigo_remote.pl --base_url=http://localhost/piwigo/dev/branches/2.5 --user=plg --password=plg --action=pwg.categories.getList --define recursive=true --define tree_output=true
...
$VAR1 = [
          {
            'global_rank' => '1',
            'nb_categories' => 1,
            'name' => 'Tout premier album',
            'sub_categories' => {
                                  '1' => {
                                           'global_rank' => '1.1',
                                           'nb_categories' => 0,
                                           'name' => 'kid 1',
                                           'representative_picture_id' => undef,
                                           'uppercats' => '1,3',
                                           'permalink' => undef,
                                           'comment' => '',
                                           'max_date_last' => undef,
                                           'id_uppercat' => '1',
                                           'url' => 'http://localhost/piwigo/dev/branches/2.5/index.php?/category/3-kid_1',
                                           'date_last' => undef,
                                           'id' => 3,
                                           'total_nb_images' => 0,
                                           'nb_images' => 0
                                         }
                                },
            'representative_picture_id' => undef,
            'uppercats' => '1',
            'permalink' => undef,
            'comment' => '',
            'max_date_last' => undef,
            'id_uppercat' => undef,
            'url' => 'http://localhost/piwigo/dev/branches/2.5/index.php?/category/1-tout_premier_album',
            'date_last' => undef,
            'id' => 1,
            'total_nb_images' => 0,
            'nb_images' => 0
          }
        ];

and in Piwigo 2.6:

$ perl tools/piwigo_remote.pl --base_url=http://localhost/piwigo/dev/branches/2.6 --user=plg --password=plg --action=pwg.categories.getList --define recursive=true --define tree_output=true
...
$VAR1 = {
          'categories' => [
                            {
                              'global_rank' => '1',
                              'nb_categories' => 1,
                              'name' => 'first album',
                              'sub_categories' => [
                                                    {
                                                      'global_rank' => '1.1',
                                                      'nb_categories' => 0,
                                                      'name' => 'kid 1',
                                                      'representative_picture_id' => undef,
                                                      'uppercats' => '1,3',
                                                      'permalink' => undef,
                                                      'comment' => '',
                                                      'max_date_last' => undef,
                                                      'id_uppercat' => '1',
                                                      'url' => 'http://localhost/piwigo/dev/branches/2.6/index.php?/category/3-kid_1',
                                                      'date_last' => undef,
                                                      'id' => 3,
                                                      'total_nb_images' => 0,
                                                      'nb_images' => 0
                                                    }
                                                  ],
                              'representative_picture_id' => undef,
                              'uppercats' => '1',
                              'permalink' => undef,
                              'comment' => '',
                              'max_date_last' => undef,
                              'id_uppercat' => undef,
                              'url' => 'http://localhost/piwigo/dev/branches/2.6/index.php?/category/1-first_album',
                              'date_last' => undef,
                              'id' => 1,
                              'total_nb_images' => 0,
                              'nb_images' => 0
                            }
                          ]
        };

With this simple change, the problem is fixed:

Code:

[pierrick@pierrick-desktop] ~/public_html/piwigo/dev/branches/2.6
$ svn diff
Index: ws.php
Index: include/ws_functions/pwg.categories.php
===================================================================
--- include/ws_functions/pwg.categories.php     (revision 26920)
+++ include/ws_functions/pwg.categories.php     (working copy)
@@ -459,7 +459,7 @@
 
   if ($params['tree_output'])
   {
-    $cats = categories_flatlist_to_tree($cats);
+    return categories_flatlist_to_tree($cats);
   }
 
   return array(

Are you OK with that?

PS 1: ws_std_get_category_xml_attributes() is nice.
PS 2: in function categories_flatlist_to_tree you changed

Code:

$tree[$key] = &$node;

into:

Code:

$tree[] = &$node;

(and the equivalent for sub_categories)
Why ? I doesn't seem to impact the mobile app, but I wonder why you changed it. I even see that in Piwigo 2.5 output, the "key" is not the category_id and was maybe there for sort order purpose (but the mobile app has no problem without it and sort order is correct)


Latest blog post (May 3rd 2018) New subscription form

Offline

 

#15 2014-01-24 17:50:16

rvelices
Piwigo Team
2005-12-29
1960

Re: Unable to refresh albums list on Piwigo iOS

plg wrote:

Why ? I doesn't seem to impact the mobile app, but I wonder why you changed it.

$key was useless and affecting output:

Look at the diff in your output:

Code:

'sub_categories' => {
                                  '1' => {

versus

Code:

'sub_categories' => [
                                                    {

First case it is an object, second case an array ...

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact