Announcement

#16 2017-08-24 12:01:36

russmcclay
Member
2017-08-24
28

Re: Everthing "works" but loads of errors at top of pages.

flop25 wrote:

PS: and try also to change the lang

I tried that, now the gallery is destroyed. Have a look:

http://winggang.com/gallery/

Offline

 

#17 2017-08-24 12:02:24

flop25
Piwigo Team
2006-07-06
7037

Re: Everthing "works" but loads of errors at top of pages.

I don't see any signs of "destruction"


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

 

#18 2017-08-24 12:12:04

russmcclay
Member
2017-08-24
28

Re: Everthing "works" but loads of errors at top of pages.

Hi flop25 --

For some reason, when I click on language the site started displaying errors everywhere.  Amazing.  But then you wrote you didn't see any destruction, so I opened the site in another browser (Chrome) and it was OK, but those initial errors, Undefined index are still there in the admin and on the Add page. Here's the SQL you asked for:

-- phpMyAdmin SQL Dump
-- version 4.0.10.7
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Aug 24, 2017 at 06:08 AM
-- Server version: 5.6.28
-- PHP Version: 5.4.31

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `winggang_piwi01`
--

--
-- Dumping data for table `piwi2e_images`
--

INSERT INTO `piwi2e_images` (`id`, `file`, `date_available`, `date_creation`, `name`, `comment`, `author`, `hit`, `filesize`, `width`, `height`, `coi`, `representative_ext`, `date_metadata_update`, `rating_score`, `path`, `storage_category_id`, `level`, `md5sum`, `added_by`, `rotation`, `latitude`, `longitude`, `lastmodified`) VALUES
(1, 'tao-teh-ching-gia-fu-feng-english-07.jpg', '2017-08-23 20:09:10', NULL, 'tao-teh-ching-gia-fu-feng-english-07', NULL, NULL, 1, 114, 933, 614, NULL, NULL, '2017-08-24', NULL, './upload/2017/08/23/20170823200910-72295849.jpg', NULL, 0, '722958499bba4c8a9b6bef10bac0c079', 1, 0, NULL, NULL, '2017-08-24 00:09:13'),
(2, 'blonde1351.jpg', '2017-08-24 00:01:17', '2010-10-25 18:56:10', 'blonde1351', NULL, NULL, 3, 155, 960, 640, NULL, NULL, '2017-08-24', NULL, './upload/2017/08/24/20170824000117-810b8f93.jpg', NULL, 0, '810b8f936b4ac00edf15fdf18ef5203d', 1, 0, NULL, NULL, '2017-08-24 04:01:17');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Offline

 

#19 2017-08-24 12:27:57

russmcclay
Member
2017-08-24
28

Re: Everthing "works" but loads of errors at top of pages.

I've added more photos to the one gallery "Jimmie Wing's Production Stills".  Everything works fine except for the errors appearing and the missing month on the photo display.

Please, anyone, have a look:

http://winggang.com/gallery/

Offline

 

#20 2017-08-24 12:35:46

flop25
Piwigo Team
2006-07-06
7037

Re: Everthing "works" but loads of errors at top of pages.


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

 

#21 2017-08-24 13:47:37

russmcclay
Member
2017-08-24
28

Re: Everthing "works" but loads of errors at top of pages.

Hi flop25 --

I am grateful for the help on this...

For your first request about lines language/en_UK/common.lang.php@L234, this is how they appear in my file:

$lang['month'][10] = "October";
$lang['month'][11] = "November";
$lang['month'][12] = "December";           
$lang['month'][1] = "January";     
$lang['month'][2] = "February";     
$lang['month'][3] = "March";
$lang['month'][4] = "April";                       
$lang['month'][5] = "May";
$lang['month'][6] = "June";     
$lang['month'][7] = "July";
$lang['month'][8] = "August";                   
$lang['month'][9] = "September";

For the second according to the suggestion in the post I created the file: local/config/config.inc.php and put this in it:

<?php
date_default_timezone_set('America/New_York');
?>

Now,  load a photo in the gallery and the same errors are there and the month is still missing from the timestamps on the right.

Anything else to try?

Last edited by russmcclay (2017-08-24 13:48:03)

Offline

 

#22 2017-08-24 14:03:56

flop25
Piwigo Team
2006-07-06
7037

Re: Everthing "works" but loads of errors at top of pages.

arg ... lit incense sticks and start incantations?

so now we are going to debug the code itself on your installation
Go to [Github] Piwigo file include/functions.inc.php@L649 in your files
edit it like that :
from

Code:

$date = str2DateTime($original, $format);

to

Code:

print_r($original);
$date = str2DateTime($original, $format);
print_r($date);

and report back the values returned on http://winggang.com/gallery/picture.php?/53/category/1


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

 

#23 2017-08-24 14:04:11

russmcclay
Member
2017-08-24
28

Re: Everthing "works" but loads of errors at top of pages.

Here's where the errors are coming from with Piwigo 2.9.1 (fresh install):

Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 665

Notice: Undefined index: month in /home/winggang/public_html/gallery/include/functions.inc.php on line 671

Here's the code in /gallery/include/functions.inc.php from that section:

/**        ------------------------------------------------------- line 636
* returns a formatted and localized date for display
*
* @param int|string timestamp or datetime string
* @param array $show list of components displayed, default is ['day_name', 'day', 'month', 'year']
*    THIS PARAMETER IS PLANNED TO CHANGE
* @param string $format input format respecting date() syntax
* @return string
*/
function format_date($original, $show=null, $format=null)
{
  global $lang;

  $date = str2DateTime($original, $format);

  if (!$date)
  {
    return l10n('N/A');
  }

  if ($show === null || $show === true)
  {
    $show = array('day_name', 'day', 'month', 'year');
  }

  // TODO use IntlDateFormatter for proper i18n

  $print = '';
  if (in_array('day_name', $show))
    $print.= $lang['day'][ $date->format('w') ].' ';  /** -----------------------> This is line 665

  if (in_array('day', $show))
    $print.= $date->format('j').' ';

  if (in_array('month', $show))
    $print.= $lang['month'][ $date->format('n') ].' ';   /** --------------------> This is line 671

  if (in_array('year', $show))
    $print.= $date->format('Y').' ';

  if (in_array('time', $show))
  {
    $temp = $date->format('H:i');
    if ($temp != '00:00')
    {
      $print.= $temp.' ';
    }
  }

  return trim($print);
}

Last edited by russmcclay (2017-08-24 14:15:01)

Offline

 

#24 2017-08-24 14:09:03

russmcclay
Member
2017-08-24
28

Re: Everthing "works" but loads of errors at top of pages.

flop25 wrote:

arg ... lit incense sticks and start incantations?

so now we are going to debug the code itself on your installation
Go to [Github] Piwigo file include/functions.inc.php@L649 in your files
edit it like that :
from

Code:

$date = str2DateTime($original, $format);

to

Code:

print_r($original);
$date = str2DateTime($original, $format);
print_r($date);

and report back the values returned on http://winggang.com/gallery/picture.php?/53/category/1

I like the incense sticks and incantations!  Here's the output:

2011-04-25 12:20:16DateTime Object ( [date] => 2011-04-25 12:20:16.000000 [timezone_type] => 3 [timezone] => UTC )
Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 668

Notice: Undefined index: month in /home/winggang/public_html/gallery/include/functions.inc.php on line 674
2017-08-24 06:17:43DateTime Object ( [date] => 2017-08-24 06:17:43.000000 [timezone_type] => 3 [timezone] => UTC )
Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 668

Notice: Undefined index: month in /home/winggang/public_html/gallery/include/functions.inc.php on line 674

Warning: Cannot modify header information - headers already sent by (output started at /home/winggang/public_html/gallery/include/functions.inc.php:650) in /home/winggang/public_html/gallery/include/page_header.php on line 101

Offline

 

#25 2017-08-24 14:31:36

flop25
Piwigo Team
2006-07-06
7037

Re: Everthing "works" but loads of errors at top of pages.

ok thx
2017-08-24 06:17:43
and
DateTime Object ( [date] => 2017-08-24 06:17:43.000000 ...
looks both good to me

Now add

print_r($lang['day']);
print_r($date->format('w'));
print_r($date->format('n'));

after print_r($date);


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

 

#26 2017-08-24 14:36:38

russmcclay
Member
2017-08-24
28

Re: Everthing "works" but loads of errors at top of pages.

2011-04-25 12:20:16DateTime Object ( [date] => 2011-04-25 12:20:16.000000 [timezone_type] => 3 [timezone] => UTC )
Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 654
14
Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 674

Notice: Undefined index: month in /home/winggang/public_html/gallery/include/functions.inc.php on line 680
2017-08-24 06:17:43DateTime Object ( [date] => 2017-08-24 06:17:43.000000 [timezone_type] => 3 [timezone] => UTC )
Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 654
48
Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 674

Notice: Undefined index: month in /home/winggang/public_html/gallery/include/functions.inc.php on line 680

Warning: Cannot modify header information - headers already sent by (output started at /home/winggang/public_html/gallery/include/functions.inc.php:650) in /home/winggang/public_html/gallery/include/page_header.php on line 101

Offline

 

#27 2017-08-24 14:47:54

flop25
Piwigo Team
2006-07-06
7037

Re: Everthing "works" but loads of errors at top of pages.

okayyyyyy

finally we have something

For a completely unknown reason, it seems that the language variables are not loaded despite the "global $lang" set like it should be and like it is done everywhere o_O
the conversion 011-04-25 12:20:16.000000 to the day of the week and the month is Ok.

you can revert back all changes (remove all print_r)

Thank you!


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

 

#28 2017-08-24 14:50:23

flop25
Piwigo Team
2006-07-06
7037

Re: Everthing "works" but loads of errors at top of pages.

maybe one last big print_r

print_r($lang);

before/after $date = str2DateTime($original, $format); doesnt matter


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

 

#29 2017-08-24 14:58:15

russmcclay
Member
2017-08-24
28

Re: Everthing "works" but loads of errors at top of pages.

Removed all the test bits...

Put the "big print_r" after:

Array ( [Closed icon position] => Closed icon position [Combine JS&CSS] => Combine JS&CSS [Debug languages] => Debug languages [Debug template] => Debug template [Give access to quick edit to photo owners even if they are not admin] => Give access to quick edit to photo owners even if they are not admin [Open toolbar by default] => Open toolbar by default [Properties page] => Properties page [Quick edit] => Quick edit [Revert] => Revert [Save] => Save [Save visit in history] => Save visit in history [Saved] => Saved [Show SQL queries] => Show SQL queries [View as] => View as [Viewing as %s.] => Viewing as %s. [left] => left [right] => right )
Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 667

Notice: Undefined index: month in /home/winggang/public_html/gallery/include/functions.inc.php on line 673
Array ( [Closed icon position] => Closed icon position [Combine JS&CSS] => Combine JS&CSS [Debug languages] => Debug languages [Debug template] => Debug template [Give access to quick edit to photo owners even if they are not admin] => Give access to quick edit to photo owners even if they are not admin [Open toolbar by default] => Open toolbar by default [Properties page] => Properties page [Quick edit] => Quick edit [Revert] => Revert [Save] => Save [Save visit in history] => Save visit in history [Saved] => Saved [Show SQL queries] => Show SQL queries [View as] => View as [Viewing as %s.] => Viewing as %s. [left] => left [right] => right )
Notice: Undefined index: day in /home/winggang/public_html/gallery/include/functions.inc.php on line 667

Notice: Undefined index: month in /home/winggang/public_html/gallery/include/functions.inc.php on line 673

Warning: Cannot modify header information - headers already sent by (output started at /home/winggang/public_html/gallery/include/functions.inc.php:651) in /home/winggang/public_html/gallery/include/page_header.php on line 101

Offline

 

#30 2017-08-24 15:01:11

flop25
Piwigo Team
2006-07-06
7037

Re: Everthing "works" but loads of errors at top of pages.

wooow
we are in the twilight zone here
He is loading the AdminTools language file!

Try to disable that plugin 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

 

Board footer

Powered by FluxBB

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