Announcement

#31 2014-11-20 16:19:54

nec
Member
2014-09-26
12

Re: FAQ? Migrating from gallery 2 to piwigo

And indeed, I have no table named :
- g2_Comment
- comment
- g2_sessions
- sessions

Offline

 

#32 2014-11-20 16:49:42

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

Re: FAQ? Migrating from gallery 2 to piwigo

nec wrote:

- Tons of

Notice: Undefined offset: 8762 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295
Notice: Undefined offset: 5041 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295
Notice: Undefined offset: 21794 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295
Notice: Undefined offset: 5039 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295
Notice: Undefined offset: 5054 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295
Notice: Undefined offset: 4657 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295
Notice: Undefined offset: 4705 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295
...

I had already seen this problem with database of ElBundy and I "fixed" it with [Github] menalto2piwigo commit b3a9f791 : are you sure you have this line 291 ?

Code:

 if (!empty($menalto_id) and isset($iid[$menalto_id]))

... because this code "should" avoid the warning you have!

For nowI don't understand how it can possible that we have inconsistent data in Gallery2 database. Maybe we don't search in the right place.

This piece of code if for searching the highlighted photo of each album.

nec wrote:

- Then :

Warning: [mysql error 1146] Table 'gal2.g2_Comment' doesn't exist

OK, I'm going to add a test before trying to query it.

nec wrote:

Warning: [mysql error 1146] Table 'gal2.sessions' doesn't exist

This is a consequence of previous problem, not a real problem.

Offline

 

#33 2014-11-20 19:12:04

nec
Member
2014-09-26
12

Re: FAQ? Migrating from gallery 2 to piwigo

The fix you just added was put minutes after my test, so no, I had not this patch included in my test.

Now, with it, here is the result (you already answered the question of the existence of the table) :

Warning: [mysql error 1146] Table 'gal2.g2_Comment' doesn't exist

SELECT
    c.g_parentId AS id,
    t.g_subject AS subject,
    t.g_comment AS comment,
    t.g_author AS author,
    FROM_UNIXTIME(t.g_date) AS date
  FROM g2_ChildEntity c
    JOIN g2_Comment t ON t.g_id = c.g_id
  WHERE t.g_publishStatus=0
in /home/sites/lvv-pw-ssl/include/dblayer/functions_mysqli.inc.php on line 830

Fatal error: Call to a member function fetch_assoc() on a non-object in /home/sites/lvv-pw-ssl/include/dblayer/functions_mysqli.inc.php on line 211

Warning: [mysql error 1146] Table 'gal2.sessions' doesn't exist

REPLACE INTO sessions
  (id,data,expiration)
  VALUES('C0A8pcun49nj3s2hob8lb6l8o4i7n0','pwg_device|s:7:\"desktop\";pwg_mobile_theme|b:0;pwg_show_metadata|b:1;pwg_uid|i:1;pwg_multiview|a:8:{s:7:\"view_as\";s:1:\"1\";s:5:\"theme\";s:19:\"stripped_black_bloc\";s:4:\"lang\";s:5:\"fr_FR\";s:12:\"show_queries\";b:0;s:10:\"debug_l10n\";b:0;s:14:\"debug_template\";b:0;s:22:\"template_combine_files\";b:1;s:10:\"no_history\";b:0;}need_update|b:0;extensions_need_update|a:0:{}',now())
; in /home/sites/lvv-pw-ssl/include/dblayer/functions_mysqli.inc.php on line 830

Offline

 

#34 2014-11-20 22:22:16

ElBundy
Member
2014-11-17
6

Re: FAQ? Migrating from gallery 2 to piwigo

Hi nec,
had as well the issue with the missing tables. You will get this when you never had the comment module in G2 enabled. As a work-a-round I enabled the module in my G2 and the needed tabels was created.
You can disable the module after this again and the error with the missing tables should be gone.

plg,
thank you!  If I find some free time I can test this with my other G2 installation tomorrow or over the weekend.

--
El

Offline

 

#35 2014-11-21 09:31:11

ElBundy
Member
2014-11-17
6

Re: FAQ? Migrating from gallery 2 to piwigo

Hi plg,
tested this now and still got a few error messages but no idea if they could be ignored.


Notice: Undefined variable: comment_inserts in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 371

Warning: array_keys() [function.array-keys]: The first argument should be an array in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 371

Notice: Undefined variable: comment_inserts in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 373

Warning: Cannot modify header information - headers already sent by (output started at /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php:371) in /<path to Webspace>/piwigo/include/page_header.php on line 101


---
El

Offline

 

#36 2014-11-22 17:16:35

como
Member
2014-11-22
3

Re: FAQ? Migrating from gallery 2 to piwigo

Today I used menalto2piwigo with a good success and migrated a large gallery 2.

There are 2 issues only, but first one can be ignored, and for second one here is the decision.

1. Several similar errors (notices):

Notice: Undefined index: 1385214 in /home/xyz/public_html/piwigo/plugins/menalto2piwigo/admin.php on line 295

2. In my titles/descriptions I have used html code, so to move correctly into Piwigo database I put PHP function html_entity_decode in 3 places in admin.php file:

on line 187 it becomes:
      $title = m2p_remove_bbcode(html_entity_decode($row[1]));

on line 193 and line 194:
      $summary = m2p_remove_bbcode(html_entity_decode($row[2]));
      $description = m2p_remove_bbcode(html_entity_decode($row[3]));

Thank you for plugin!

Offline

 

#37 2014-11-24 10:28:31

Gork
Member
2014-11-24
4

Re: FAQ? Migrating from gallery 2 to piwigo

I hope it is proper for me to post in this thread the SQL errors I am encountering while trying to migrate from Gallery 3 to Piwigo.  I know the FAQ is for "gallery 2", but I've also read that the Menalto2Piwigo plugin has been updated to work with Gallery 3 as well.  In addition, though the errors I am sharing seem to be related to errors others have posted, they are not exactly the same.  If I need to post elsewhere please kindly let me know.  I am looking for any assistance to try to get through this process without the errors.

Menalto2Piwigo version 2.7.a
Piwigo version 2.7.2
Gallery 3 version 3.0.9

In case it's an issue, I enabled the LocalFiles Editor plugin and added the following line to enable some special characters in my filenames.  I also removed all the apostrophes from the filenames of all photos because they caused MySQL errors during the process.  (As I'm typing this I'm wondering if doing that without somehow updating the Gallery 3 database may be the root of my problem?)

LocalFiles Editor:
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.&, !]+$/';

The errors I am receiving:

Notice: Undefined variable: comment_inserts in /var/apache/piwigo/plugins/menalto2piwigo/admin.php on line 579

Warning: array_keys() expects parameter 1 to be array, null given in /var/apache/piwigo/plugins/menalto2piwigo/admin.php on line 579

Notice: Undefined variable: comment_inserts in /var/apache/piwigo/plugins/menalto2piwigo/admin.php on line 581

Notice: Undefined variable: image_tag_inserts in /var/apache/piwigo/plugins/menalto2piwigo/admin.php on line 619

Warning: array_keys() expects parameter 1 to be array, null given in /var/apache/piwigo/plugins/menalto2piwigo/admin.php on line 619

Notice: Undefined variable: image_tag_inserts in /var/apache/piwigo/plugins/menalto2piwigo/admin.php on line 621

Last edited by Gork (2014-11-24 10:35:42)

Offline

 

#38 2014-11-24 11:08:33

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

Re: FAQ? Migrating from gallery 2 to piwigo

I have published a new version 2.7.b of plugin menalto2piwigo, fixing many of the bugs quoted here.

Gork wrote:

$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.&, !]+$/';

Yes, I had to use this configuration setting before launching synchronization in Piwigo, because Menalto Gallery was much more open to exotic characters than Piwigo (the most difficult was the apostrophe ').

como wrote:

2. In my titles/descriptions I have used html code, so to move correctly into Piwigo database I put PHP function html_entity_decode in 3 places in admin.php file:

on line 187 it becomes:
      $title = m2p_remove_bbcode(html_entity_decode($row[1]));

on line 193 and line 194:
      $summary = m2p_remove_bbcode(html_entity_decode($row[2]));
      $description = m2p_remove_bbcode(html_entity_decode($row[3]));

I have to check this, mainly if it doesn't break other things.

Offline

 

#39 2014-11-24 11:40:40

Gork
Member
2014-11-24
4

Re: FAQ? Migrating from gallery 2 to piwigo

You actually got the apostrophe to work in the end with a migration?!  Or do you just mean that's the hardest one to fix in the Piwigo code?

After my last post I downloaded commit 41973f0668 from GIT and ran it atop of what I had already done.  It didn't come back with any SQL errors, but the result is that I have several photos which don't show up in the Piwigo gallery; I only get the ! in a triangle.  Some of these I can click on to see the underlying photos, and others I cannot.

Should just changing the filenames of the photos to remove the apostrophes cause any problems with the migration?

I'll start from scratch again with 2.7.b when I get a chance and post the results.

Offline

 

#40 2014-11-24 11:47:21

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

Re: FAQ? Migrating from gallery 2 to piwigo

Gork wrote:

You actually got the apostrophe to work in the end with a migration?!  Or do you just mean that's the hardest one to fix in the Piwigo code?

I managed to make the Piwigo synchronization work, even with apostrophe in filenames, and many weird characters :

Code:

$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.(), \'’&$£@#~öùüéá!\[\]]+$/';

... and I modified file:

Code:

~/public_html/piwigo/dev/branches/2.7
$ svn diff
Index: admin/site_update.php
===================================================================
--- admin/site_update.php       (revision 30376)
+++ admin/site_update.php       (working copy)
@@ -218,8 +218,8 @@
     {
       $insert = array(
         'id'          => $next_id++,
-        'dir'         => $dir,
-        'name'        => str_replace('_', ' ', $dir),
+        'dir'         => pwg_db_real_escape_string($dir),
+        'name'        => pwg_db_real_escape_string(str_replace('_', ' ', $dir)),
         'site_id'     => $site_id,
         'commentable' =>
           boolean_to_string($conf['newcat_default_commentable']),
@@ -509,10 +509,10 @@
 
     $insert = array(
       'id'             => $next_element_id++,
-      'file'           => $filename,
-      'name'           => get_name_from_file($filename),
+      'file'           => pwg_db_real_escape_string($filename),
+      'name'           => pwg_db_real_escape_string(get_name_from_file($filename)),
       'date_available' => CURRENT_DATE,
-      'path'           => $path,
+      'path'           => pwg_db_real_escape_string($path),
       'representative_ext'  => $fs[$path]['representative_ext'],
       'storage_category_id' => $db_fulldirs[$dirname],
       'added_by'       => $user['id'],

But I know the thumbnail generation doesn't work with some characters (certainly the "!" is one of them).

Immediately after the synchronization, I ran [extension by plg] Virtualize which solved all kind of problem related to characters in filenames (but I know many people coming from Menalto won't like the idea to change the folder organization, which is what Virtualize does)

Offline

 

#41 2014-11-24 12:24:39

Gork
Member
2014-11-24
4

Re: FAQ? Migrating from gallery 2 to piwigo

Virtualize...  Yes, I am one of those Gallery people who really want to have my naming convention intact.  Reason is, if I set everything up for Piwigo and it goes the way Menalto did I'm no longer left with something I may be able to easily import into another similar gallery program.  And if I one day have to go back to static web pages of my own design, possibly losing descriptions would be bad enough, but losing descriptive filenames in descriptive directories would be the end of the organization of my photos. :(  Heck, I have a lot of old digitized photos with no EXIF data - if I lost the filenames I'd lose the dates.

Ahh, so it would appear the missing thumbnails are probably caused by non-Piwigo-standard characters then.  When I click on missing thumbnails, most of the ones I've tested so far take me to the actual photo.  But not all.

Thanks for sharing the change to the code which allowed you to use apostrophes!  I'm trying to decide if I'm going to try to incorporate that or wait until the change is available in a normal Piwigo upgrade.  If I make the changes manually would an automatic Piwigo upgrade still work properly afterwards?

I tried installing 2.7.b and running it over what I'd already done with the commit version (probably the same thing.)  No change.  But I don't think I'll be trying the process from scratch again tonight.  It doesn't sound like it will change anything but we shall see when I get a chance to try again.

EDIT:
Looks like my biggest problem with the thumbnails being generated properly is the ampersand (&) character.  I still haven't figured out what character might be causing the photos to not display on some of these bad thumbnail entries though.

Last edited by Gork (2014-11-24 12:39:34)

Offline

 

#42 2014-11-24 12:51:18

wsloand
Member
2014-11-17
31

Re: FAQ? Migrating from gallery 2 to piwigo

I just tried the new version, and I'm getting a similar error:

Error, c273 is not an image and Menalto says it is an image


Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.g_pathComponent='IMG_2274.CR2'' at line 16

SELECT
    f.g_id,
    i.g_title,
    i.g_summary,
    i.g_description,
    i.g_canContainChildren,
    a.g_orderWeight,
    a.g_viewCount,
    FROM_UNIXTIME(e.g_creationTimestamp)
  FROM g2_Item i
    JOIN g2_FileSystemEntity f ON i.g_id = f.g_id
    JOIN g2_ChildEntity c ON f.g_id = c.g_id
    JOIN g2_ItemAttributesMap a ON i.g_id = a.g_itemId
    JOIN g2_Entity e ON e.g_id = i.g_id
  WHERE c.g_parentId =
    AND f.g_pathComponent='IMG_2274.CR2'
; in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 830


Fatal error: Call to a member function fetch_row() on a non-object in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 216


Warning:  [mysql error 1146] Table 'gallery2.piwigo_sessions' doesn't exist

REPLACE INTO piwigo_sessions
  (id,data,expiration)
  VALUES('[removed]','pwg_uid|i:1;pwg_device|s:7:\"desktop\";pwg_mobile_theme|b:0;need_update|b:0;extensions_need_update|a:0:{}',now())
; in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 830

Offline

 

#43 2014-11-24 12:56:26

Gork
Member
2014-11-24
4

Re: FAQ? Migrating from gallery 2 to piwigo

wsloand wrote:

I just tried the new version, and I'm getting a similar error:

Part of what you posted looks like it could be from file/folder names with apostrophes.  Do any of your file or folder names contain apostrophes?  If so, see my post above for the solution I used and @plg's post for a more eloquent solution.

Offline

 

#44 2014-11-24 13:44:41

wsloand
Member
2014-11-17
31

Re: FAQ? Migrating from gallery 2 to piwigo

Hmm, I manually applied @plg's diff in admin/site_update.php, and I expanded $conf['sync_chars_regex'] to @plg's suggestion, but I'm still getting the same error.

I don't think I'm missing any of the changes mentioned in the thread-- do I need to download the current git repository?

Offline

 

#45 2014-11-24 13:51:57

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

Re: FAQ? Migrating from gallery 2 to piwigo

The current Git is exactly the same as plugin version 2.7.b (just look at file pem_metadata.txt in your plugin).

I contact you by email.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact