WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

Du bist nicht angemeldet.

#1 13.07.2020 12:28:56

gks
Mitglied

Notice bzw. Warnings bzgl. functions.php

Hallo,

ich verwende die aktuelle Version 1.3.11 des ProCalendar aus dem AOR von WBCE.

In regelmäßigen Abständen werden die folgenden Meldungen in den Errorlog geschrieben:

[== PHP ==]
2020-07-12T00:38:08+00:00 [Notice] /modules/procalendar/functions.php:[1070] from /framework/frontend.functions.php:[365] "Undefined variable: tmp"
2020-07-12T00:38:08+00:00 [Warning] /modules/procalendar/functions.php:[1138] from /modules/procalendar/functions.php:[1070] ShowActionEntry "mktime() expects parameter 6 to be int, string given"
2020-07-12T00:38:08+00:00 [Warning] /modules/procalendar/functions.php:[1139] from /modules/procalendar/functions.php:[1070] ShowActionEntry "mktime() expects parameter 6 to be int, string given" 

Woran könnte das liegen und wie werde ich diese Meldungen los?

Danke für das Interesse und (im Voraus) für die Hilfe.

GKS

Beitrag geändert von gks (13.07.2020 12:32:13)


WBCE Version: 1.6.2
PHP Version: 8.1.27
MySQL Version: 5.7.38
Hoster: Strato  facepalm

Offline

#2 13.07.2020 13:31:30

florian
Administrator

Re: Notice bzw. Warnings bzgl. functions.php

So weit ich sehe, passiert das, wenn die Procalendar-Seite mit Parametern aufgerufen wird, zu denen es keinen Eintrag (mehr) gibt. Auch die Übergabe von unsinnigen Datumsformaten (month=17, day=32 usw) kann Warnings verursachen.

Aktualisiere bitte mal auf Version 1.3.12 (hängt hier an) oder

- ergänze in der /modules/procalendar/view.php nach

$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;

folgenden Code:

if ($month < 1 || $month > 12) { $month = date("n");}
if ($day < 1 || $day > 31) { $day = "";}
if ($year < 1970 || $year > 2050) { $year = date("Y");}

- ändere in der /modules/procalendar/functions.php Zeile 1050ff

//######################################################################
function ShowActionDetailsFromId ($actions, $id, $section_id, $day)
//
//  Return: nothing
//
//
//######################################################################
{
  global $CALTEXT, $database, $admin;

  foreach ($actions AS $a) {
  	if ($a["id"] == $id && date("d", strtotime($a['date_start'])) == $day) {
  		$tmp =$a;
  		break;
  	}
  }
	ShowActionEntry($tmp, $section_id);
}

zu

//######################################################################
function ShowActionDetailsFromId ($actions, $id, $section_id, $day)
//
//  Return: nothing
//
//
//######################################################################
{
  global $CALTEXT, $database, $admin;

  $tmp='';
  foreach ($actions AS $a) {
  	if ($a["id"] == $id && date("d", strtotime($a['date_start'])) == $day) {
  		$tmp =$a;
  		break;
  	}
  }
  if ($tmp!='') {
	ShowActionEntry($tmp, $section_id);
  } else {
	  echo '<p>'.$CALTEXT['NODATES'].'</p>';
	  echo '<p><a href="javascript:history.back()">'.$CALTEXT['BACK'].'</p>';
  }
}

Code allein macht nicht glücklich. Jetzt spenden!

Offline

#3 13.07.2020 14:02:54

gks
Mitglied

Re: Notice bzw. Warnings bzgl. functions.php

Vielen Dank,

ich habe den bequemen Weg (update auf 1.3.12) gewählt und werde morgen mal wieder auf den errorlog-Viewer schauen.

Ich gebe dann in einigen Tagen mal eine Rückmeldung, ob die Notice und die Warnings noch auftauchen oder nicht.

Nochmal vielen Dank für die prompte Hife sowie die Erklärungen zu möglichen Ursachen.

Gruß GKS


WBCE Version: 1.6.2
PHP Version: 8.1.27
MySQL Version: 5.7.38
Hoster: Strato  facepalm

Offline

Liked by:

florian

#4 14.07.2020 13:21:21

gks
Mitglied

Re: Notice bzw. Warnings bzgl. functions.php

Kurze Rückmeldung:

Bis jetzt keine Notice/Warnings mehr aufgetaucht  thumb_up

Gruß GKS


WBCE Version: 1.6.2
PHP Version: 8.1.27
MySQL Version: 5.7.38
Hoster: Strato  facepalm

Offline

Liked by:

florian

#5 30.07.2020 15:59:33

giz
Mitglied

Re: Notice bzw. Warnings bzgl. functions.php

Hinweis zu Version 1.3.14

2020-07-30T06:35:03+00:00 [Deprecated] /modules/procalendar/functions.php:[469] from /modules/procalendar/view.php:[62] ShowActionList "Invalid characters passed for attempted conversion, these have been ignored" 

Modul funktioniert einwandfrei


WBCE 1.6.1 - Fraggy 2.7.1 - PHP 8.2.13- All-inkl
Ein Leben ohne Hund ist möglich, aber sinnlos

Offline

Liked by:

gks

#6 30.07.2020 17:02:13

florian
Administrator

Re: Notice bzw. Warnings bzgl. functions.php

Korrigierte Version im AOR verfügbar
https://addons.wbce.org/pages/addons.ph … em&item=19


Code allein macht nicht glücklich. Jetzt spenden!

Offline

Liked by:

giz

Fußzeile des Forums

up