1
playsome
extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/14 16:08

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hello all,

I am currently testing an upgrade on a test site xoops 2.4.5 to 2.5.4 upgrade went ok I have installed the new extcal also (2.27 beta) this si the latest release I can find.

I gather from other posts that there is issues with the dateformat, which i was getting errors. I have used part of the fix for extcal found on frxoops (although im not sure which version of the module the fix is intended for)

I have removed the 2 chunks of code which test if the date format it wrong I could not find this section of code however in the file class/event.php

list( $year $month $day ) = explode "-" $data 'event_start' ][ 'date' ]);
$data 'event_start' ] = mktime $month $day $year ) + $data 'event_start' ][ 'time' ];
list( 
$year $month $day ) = explode "-" $data 'event_end' ][ 'date' ]);
$data 'event_end' ] = mktime $month $day $year ) + $data 'event_end' ][ 'time' ];

if( 
$data 'have_end' ] == || $data 'event_start' ] > $data 'event_end' ]) {
$data 'event_end' ] = $data 'event_start' ];
}


The above lines where to be replaced by other lines of code.

Anyway, after applying what i could of the fix I can now submit an event and it does not show the wrong date format error BUT the event does not show in teh calendar view, it does say there is events in the DB on admin side.

Another error i have noticed is when clicking to edit an event the date will revert to 1/1/1970 which is not good.

The only errors that are produced by debug are:

NoticeConstant _MD_EXTCAL_ICONE_CLONE already defined in file /modules/extcal/language/english/main.php line 174
Notice
Constant _MD_EXTCAL_ICONE_EDIT already defined in file /modules/extcal/language/english/main.php line 175
Notice
Constant _MD_EXTCAL_ICONE_DELETE already defined in file /modules/extcal/language/english/main.php line 176


I have extcal 2.27 beta running fine on another test site which has xoops 2.4.1a installed so this is clearly an issue with the latest release of xoops.

Will extcal be fixed or xoops be fixed anytime soon? will the new blue move extcal come out of beta soon?

Thanks

2
playsome
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/14 16:30

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Quick update,

I had done the first part of the suggested fix which is change

define "_SHORTDATESTRING" "d/m/Y" );


in language/english.global.php to

define "_SHORTDATESTRING" "dmY" );


i had changed the php date to d/n/Y to make it more suitable for UK, upon reverting back to d/m/Y the date no longer changes to 1/1/1970, not sure why that would make a difference but it did.

so extcal seems to be working OK now, bit more testing to do and I am still concerned about not being able to find the chunk of code in class/event.php incase replacing that is vital.

Just a quick suggestion for a feature which i think should be added to extcal:

when creating a recurring event which say starts on 1/1/2012 and recurs on the same day and time every week i input the start and end date as 1/1/2012 and select recur weekly on monday for x amount of weeks which is fine.

However, if a user clicks on the event the next week i.e 8/1/2012 the date will still show as 1/1/2012, I think it would make more sense if the date the user clicked on showed on the event page?

Cheers

3
Mamba
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/14 22:29

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Shoudn't it be:

define("_SHORTDATESTRING","d-m-Y");


If you used Google Translator for the XOOPS France message, it removed the "-" dashes, and it showed the code as:

define("_SHORTDATESTRING""dmY" );


which is probably not what you wanted.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

4
redheadedrod
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues

Yes if it is dmY it will show as 12282012 as opposed to 12-28-2012.

I mentioned this elsewhere but the database has to have a specific format for the date to be saved. If it is not right and you read this date in from the database it will show up as an unknown date.

If you are getting a date returned as 1/1/1970 that is an indication that the date that is stored in the variable you are using is wrong. It got corrupted during a conversion somewhere most likely.

The date has to be converted to the database compatible format or it will be saved wrong and show up as the 1/1/1970 as mentioned above.






Attending College working towards Bachelors in Software Engineering and Network Security.

5
Mage
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/16 9:58

  • Mage

  • Core Developer

  • Posts: 206

  • Since: 2009/8/2 1


Hello mamba!

define("_SHORTDATESTRING","d-m-Y");


it's true! The translation removed the "-".

Changing the file "languages/english/global.php":

define "_SHORTDATESTRING" "????" );


with:

define("_SHORTDATESTRING","d-m-Y");



For extcal the solution is:

Edit "post.php". Remove the lines:

// If the date format is wrong
if(! preg_match '`[0-9]{4}-[01][0-9]-[0123][0-9]`' $_POST 'event_start' ][ 'date' ]) || ! preg_match '`[0-9]{4}-[01][0-9]-[0123][0-9]`' $_POST 'event_end' ][ 'date' ])) {
redirect_header 'index.php' _MD_EXTCAL_WRONG_DATE_FORMAT "<br />" implode '<br />' $GLOBALS 'xoopsSecurity' ]-> getErrors ()));
exit;
}


Edit "class/event.php". Remove the lines:

list( $year $month $day ) = explode "-" $data 'event_start' ][ 'date' ]);
$data 'event_start' ] = mktime $month $day $year ) + $data 'event_start' ][ 'time' ];
list( 
$year $month $day ) = explode "-" $data 'event_end' ][ 'date' ]);
$data 'event_end' ] = mktime $month $day $year ) + $data 'event_end' ][ 'time' ];
if( 
$data 'have_end' ] == || $data 'event_start' ] > $data 'event_end' ]) {
$data 'event_end' ] = $data 'event_start' ];
}


add these lines instead

$data 'event_start' ] = strtotime $data 'event_start' ][ 'date' ]) + $data 'event_start' ][ 'time' ];
$data 'event_end' ] = strtotime $data 'event_end' ][ 'date' ]) + $data 'event_end' ][ 'time' ];


Edit "class/event.php". Remove the lines:

// If the date format is wrong
if(! preg_match '`[0-9]{4}-[01][0-9]-[0123][0-9]`' $_POST 'event_start' ][ 'date' ]) || ! preg_match '`[0-9]{4}-[01][0-9]-[0123][0-9]`' $_POST 'event_end' ][ 'date' ])) {
redirect_header 'index.php' _MD_EXTCAL_WRONG_DATE_FORMAT "<br />" implode '<br />' $GLOBALS 'xoopsSecurity' ]-> getErrors ()));
exit;
}

6
Yurdal
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/16 16:29

  • Yurdal

  • Friend of XOOPS

  • Posts: 386

  • Since: 2005/3/27


@mage thanks for the suggestion but i have extcal 2.34 beta from tje link that mamba gives earlyer

I dont have those lineĀ“s in post.php and event.php !
so is there a solution for the 2.34 version ?

7
Anonymous
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/16 20:27

  • Anonymous

  • Posts: 0

  • Since:


@Yurdal do you mean 2.24?

8
Yurdal
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/17 8:37

  • Yurdal

  • Friend of XOOPS

  • Posts: 386

  • Since: 2005/3/27


@renetjuh
Now it is real 2.34 beta , i found it on a link that mamba gives before on a another tread here

9
Stijnvd
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/26 20:03

  • Stijnvd

  • Just popping in

  • Posts: 16

  • Since: 2011/12/14


I updated towards beta 2 (found on the link from Mamba onhttp://sourceforge.net/projects/xfr/files/Modules/version_originale/XOOPS%202.5.x/)

But I cannot try to add events because I receive a white page when trying to add events.
When turning debugging on the following error comes up:

Fatal error: Cannot redeclare obtainURL() (previously declared in /opt/www/vandammes3/web/www.seminarieweb.be/class/xoopsblock.php(157) : eval()'d code:7) in /opt/www/vandammes3/web/www.seminarieweb.be/class/xoopsblock.php(157) : eval()'d code on line 9
None All Errors (4) Deprecated (0) Queries (23) Blocks (14) Extra (2) Timers(5)

Has it something to do with the beta or ???

10
Anonymous
Re: extcal 2.27 beta and xoops 2.5.4 errors/issues
  • 2012/1/26 21:09

  • Anonymous

  • Posts: 0

  • Since:


For extcal 2.2.4 the solution is:

Edit "post.php". Remove the lines 65-75:

// If the date format is wrong
if(! preg_match '`[0-9]{4}-[01][0-9]-[0123][0-9]`' $_POST 'event_start' ][ 'date' ]) || ! preg_match '`[0-9]{4}-[01][0-9]-[0123][0-9]`' $_POST 'event_end' ][ 'date' ])) { redirect_header 'index.php' _MD_EXTCAL_WRONG_DATE_FORMAT "<br />" implode '<br />' $GLOBALS 'xoopsSecurity' ]-> getErrors ())); exit; }


Edit "class/event.php". Remove the lines 172-182:

list( $year $month $day ) = explode "-" $data 'event_start' ][ 'date' ]); $data 'event_start' ] = mktime $month $day $year ) + $data 'event_start' ][ 'time' ]; list( $year $month $day ) = explode "-" $data 'event_end' ][ 'date' ]); $data 'event_end' ] = mktime $month $day $year ) + $data 'event_end' ][ 'time' ]; if( $data 'have_end' ] == || $data 'event_start' ] > $data 'event_end' ]) { $data 'event_end' ] = $data 'event_start' ]; }


add these lines instead:

$data 'event_start' ] = strtotime $data 'event_start' ][ 'date' ]) + $data 'event_start' ][ 'time' ]; $data 'event_end' ] = strtotime $data 'event_end' ][ 'date' ]) + $data 'event_end' ][ 'time' ];


Edit "admin/event.php". Remove the lines 29-39:

// If the date format is wrong
if(! preg_match '`[0-9]{4}-[01][0-9]-[0123][0-9]`' $_POST 'event_start' ][ 'date' ]) || ! preg_match '`[0-9]{4}-[01][0-9]-[0123][0-9]`' $_POST 'event_end' ][ 'date' ])) { redirect_header 'index.php' _MD_EXTCAL_WRONG_DATE_FORMAT "<br />" implode '<br />' $GLOBALS 'xoopsSecurity' ]-> getErrors ())); exit; }


Hopefully there will come a normal solution in the core.

Login

Who's Online

179 user(s) are online (120 user(s) are browsing Support Forums)


Members: 0


Guests: 179


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits