Announcement

#1 2012-02-20 18:30:41

wernerk
Member
2012-01-22
31

Zero month bug

Hello,

normally you can enter a date without month and day at least in the single photo modifying dialog of the album administration.

If you enter the date without day, everything works fine. Ok, "00 January 2012" does not look very nice, but it's useful. But if you skip the month and look at the photo on the photo page, you get the report: "Undefined offset: 0 in ... include/functions.inc.php on line 525". Obviously the program does not like a zero-entry for the month.

But this is allowed! Otherwise there wouldn't be these "----" in the date selectors.

Except on the normal upload page, where you get a "wrong date" alert. But this is also a bug, because on the album admin page you _can_ do this and it makes sense, because if you have old photos and you don't know the exact date, you can input at least the year.

If you cannot fix this at the moment, perhaps you could give me a hint or a peace of code to do it myself? ;-)

Greetings
Werner

Offline

 

#2 2012-02-20 21:05:48

wernerk
Member
2012-01-22
31

Re: Zero month bug

Hello,

the bug is in line 523 in function.inc.php. I used a modified php file, so it was reported two lines later ;-)

The problem is that there is no name for the month "00".

So I have changed the code and now it seems to work:


if ($ymdhms[0] >= 1970)
  {
    If ($ymdhms[2] > 0)
    {
      $formated_date.= $lang['day'][date('w', mktime(12,0,0,$ymdhms[1],$ymdhms[2],$ymdhms[0]))];
      $formated_date.= ' '.$ymdhms[2];
    }
  }
  If ((int)$ymdhms[1] > 0)
  {
    $formated_date.= ' '.$lang['month'][(int)$ymdhms[1]];
  }


Hope I've done it well ...

I do not know how and if "00" parameters are displayed in the calendar.

So the first bug is fixed. ;-)

Now the "----" entries in the direct upload dialog have to be unblocked ... ;-)

Greetings
Werner

Offline

 

#3 2012-02-20 21:45:08

wernerk
Member
2012-01-22
31

Re: Zero month bug

Hello,

I've removed the checkdate in picture_modify.php, so also this bug is fixed. Well, you can now enter things like "33 August" - to check this out would be possible but very complex ... But in batch_manager_unit.php it is not either implemented.

Greetings
Werner

Offline

 

#4 2012-02-20 22:31:35

Eric
Former Piwigo Team
VALENCE (FR)
2005-03-25
1768

Re: Zero month bug

Hi wernerk,

I reproduce the bug on Piwigo 2.3.3 and 2.4b2. I've opened a bug in the bugtracker : [Bugtracker] ticket 2582

Thx for your report !

Offline

 

#5 2012-02-20 22:53:40

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

Re: Zero month bug

Thank you wernerk for your in-depth investigation. I'll make a review of this issue tomorrow.

Offline

 

#6 2012-02-21 00:50:43

wernerk
Member
2012-01-22
31

Re: Zero month bug

Hello,

perhaps you can also think about changing the expressions in the image footer "created on" and "posted on" to "created" and "posted" or "creation date" and "posting date". "Created on 2012" does not really sound so well ;-) The problem appears in most languages.

Greetings
Werner

Offline

 

#7 2012-02-21 00:53:07

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

Re: Zero month bug

Currently, Piwigo is not designed to support partial date.

Offline

 

#8 2012-02-21 01:02:08

wernerk
Member
2012-01-22
31

Re: Zero month bug

plg wrote:

Currently, Piwigo is not designed to support partial date.

The language adaption is not so important. The main thing is that partial dates work technically. And they seem to do after this little patch. Even the calendars allow "zero" entries. I think partial date has already been implemented, otherwise the "----" blanks in the picture modify dialog would make no sense.

Offline

 

#9 2012-02-21 10:13:24

Eric
Former Piwigo Team
VALENCE (FR)
2005-03-25
1768

Re: Zero month bug

Blanks (----)  are usefull with metedata synch. When you upload some pics and these pics have IPTC data like "creation date", the date in picture modify dialog is automatically filled. If there is no data or "creation date" with the pics, the date is put to ------ to avoid null entries in database.

But what's abnormal is to be able to set a blank for only one of the date fields. If one is set to blank, all others have to be set to blank too.

Offline

 

#10 2012-02-22 02:37:47

wernerk
Member
2012-01-22
31

Re: Zero month bug

Hello Eric,

Eric wrote:

Blanks (----)  are usefull with metedata synch. When you upload some pics and these pics have IPTC data like "creation date", the date in picture modify dialog is automatically filled. If there is no data or "creation date" with the pics, the date is put to ------ to avoid null entries in database.

But what's abnormal is to be able to set a blank for only one of the date fields. If one is set to blank, all others have to be set to blank too.

That's interesting. I'll check it out. But I thought of the "----" in the selector menus. Although you can select them, it is not allowed ...?

Though it is useful. Think of the poor people who want to post analog (huh, what's that??? 8-)) photos. Perhaps they have some scanned old slides and do not exactly know the date. So they can select "June 1997" or perhaps "1968". Oh no, they can't, because of the 1970 limitation. ;-) Well, I don't need day names, so for my personal purpose I had to do another little modification. ;-) And it works fine. Even the null entries seem to be harmless. These dates are not displayed in the calendar, but this is no real problem.

Greetings
Werner

Offline

 

Board footer

Powered by FluxBB

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