Startseite
  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche
Startseite › Forum › Drupalcenter.de › Allgemeines zu Drupal ›

Fehlermeldung nach Update auf Drupal 10

Eingetragen von Rubi_2021 (13)
am 03.09.2023 - 14:18 Uhr in
  • Allgemeines zu Drupal
  • Drupal 9.x oder neuer

Hallo zusammen,

Ich habe ein Update meiner Drupal-Seite durchgeführt.

Ich erhalte in der Konsole nachdem ich auf Terminbuchung klicke in der Konsole einen Fehler. Der Termin wird zwar gebucht aber die Seite bleibt wie im Bild im Anhang.

Bitte helft mir :)

Was könnte das Problem bei dieser Funktion sein ?

public function saveappointmentuser(){

@$user_current = \Drupal::currentUser()->id();
@$user_info_current = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
$userID_current = $user_info_current->uid->value;

$query = \Drupal::entityQuery('node');
$query->accessCheck(TRUE);
$query->condition('type', array('calendar_main'), 'IN');
$query->condition('status', 1);
$query->condition('uid', intval($_POST['owner']));
$query->sort('nid', 'DESC');
$entity_ids = $query->execute();

$entity_ids = reset($entity_ids);

if(isset($_POST['mykalendarpage']) && intval($_POST['mykalendarpage']) == 1){
$name_appointment = 'Termin '.$this->counterappointments($entity_ids);
}elseif(isset($_POST['mycreatepage']) && intval($_POST['mycreatepage']) == 1){
$name_appointment = 'Termin '.$this->counterappointments($entity_ids);
}else{
$name_appointment = 'Buchung '.$this->counterappointments($entity_ids);
}

$appointment_data = array();
$appointment_data['type'] = 'calendar_entries';
$appointment_data['uid'] = intval($userID_current);
$appointment_data['title'] = $name_appointment;
$appointment_data['body'] = $_POST['text'];
$appointment_data['field_calendar_selected_date'] = $_POST['date_format'];
$appointment_data['field_calendar_selected_hour'] = $_POST['hour'];
$appointment_data['field_calendar_id_assoc'] = intval($entity_ids);
$appointment_data['field_calendar_entry_key'] = $_POST['date_format'].'>'.$_POST['hour'].'>'.$entity_ids;
$appointment_data['field_calendar_entry_type'] = $_POST['type'];

$appointment_data['status'] = 1;

#$created_appointment = entity_create('node', $appointment_data);
#$created_appointment->save();

$created_appointment = \Drupal::entityTypeManager()->getStorage('node')->create($appointment_data);
$created_appointment->save();
$appointment_id = $created_appointment->uid->value;
$load_calendar = Node::load(intval($entity_ids));

$array_apppintments = array();
foreach ($load_calendar->get('field_calendar_entry_assoc')->getValue() as $key => $value) {
$appointmentload = Node::load(intval($value['target_id']));
if(!is_object($appointmentload)){

}else{
$array_apppintments[] = $value['target_id'];
}
}
$load_calendar->field_calendar_entry_assoc = $array_apppintments;
$load_calendar->save();

$load_calendar = Node::load(intval($entity_ids));
$appointment_list_data = $load_calendar->get('field_calendar_entry_assoc')->getValue();

if (empty($appointment_list_data)) {
$load_calendar->field_calendar_entry_assoc[0] = $appointment_id;
$load_calendar->save();
} elseif(!empty($appointment_list_data)) {
$appointment_count = count($appointment_list_data);
$load_calendar->field_calendar_entry_assoc[$appointment_count] = $appointment_id;
$load_calendar->save();
}

if(intval($userID_current) != intval($_POST['owner'])){

//email send
$custom_mails = new CemailController();

$current_user = \Drupal\user\Entity\User::load($userID_current);
$owner_kalendar = \Drupal\user\Entity\User::load(intval($_POST['owner']));
$custom_mails->userbookedmail($current_user);
$custom_mails->teacherbookedmail($owner_kalendar);
//email send

//create chat

//chat validation
$query = \Drupal::entityQuery('node');
$query->accessCheck(TRUE);
$query->condition('type', array('chat_content'), 'IN');
$query->condition('status', 1);
$query->condition('field_chat_user_from', array($userID_current),"IN");
$query->condition('field_chat_user_to', array($_POST['owner']),"IN");
$query->sort('nid', 'DESC');
$entity_ids = $query->execute();

$query_second = \Drupal::entityQuery('node');
$query_second->accessCheck(TRUE);
$query_second->condition('type', array('chat_content'), 'IN');
$query_second->condition('status', 1);
$query_second->condition('field_chat_user_from', array($_POST['owner']),"IN");
$query_second->condition('field_chat_user_to', array($userID_current),"IN");
$query_second->sort('nid', 'DESC');
$entity_ids_second = $query_second->execute();
//chat validation

if(!empty($entity_ids)){

//create message

$subject = 'User Comment ID '.htmlspecialchars($userID_current, ENT_QUOTES, 'UTF-8');
$chatmessage = '

'.htmlspecialchars($_POST['text'], ENT_QUOTES, 'UTF-8').'

';

$values = [
'entity_type' => 'node',
'entity_id' => end($entity_ids),
'field_name' => 'comment',
'uid' => $userID_current,
'comment_type' => 'comment',
'subject' => $subject,
'comment_body' => strip_tags($chatmessage),
'status' => 1
];

$comment = Comment::create($values);
$comment->save();

//create message

/*echo $GLOBALS['base_url'].'/partner/profile/chat/'.$userID_current.'#'.end($entity_ids);
die();*/

$custom_url = $GLOBALS['base_url'].'/buchungerfolgreich';

#drupal_set_message(t("Deine Buchung wurde erfolgreich durchgeführt."), 'status');
echo $custom_url;

}elseif(!empty($entity_ids_second)){

//create message

$subject = 'User Comment ID '.htmlspecialchars($userID_current, ENT_QUOTES, 'UTF-8');
$chatmessage = '

'.htmlspecialchars($_POST['text'], ENT_QUOTES, 'UTF-8').'

';

$values = [
'entity_type' => 'node',
'entity_id' => end($entity_ids_second),
'field_name' => 'comment',
'uid' => $userID_current,
'comment_type' => 'comment',
'subject' => $subject,
'comment_body' => strip_tags($chatmessage),
'status' => 1
];

$comment = Comment::create($values);
$comment->save();

//create message

/* echo $GLOBALS['base_url'].'/partner/profile/chat/'.$userID_current.'#'.end($entity_ids_second);
die();*/

$custom_url = $GLOBALS['base_url'].'/buchungerfolgreich';
#drupal_set_message(t("Deine Buchung wurde erfolgreich durchgeführt."), 'status');
echo $custom_url;

}else{
$chatcreation = array();
$chatcreation['type'] = 'chat_content';
$chatcreation['uid'] = intval($userID_current);
$chatcreation['title'] = "Chat between: ID-".$userID_current." and ID-".$_POST['owner'];
$chatcreation['body'] = "Chat between: ID-".$userID_current." and ID-".$_POST['owner'];
$chatcreation['field_chat_user_from'] = $userID_current;
$chatcreation['field_chat_user_to'] = $_POST['owner'];
$chatcreation['status'] = 1;

$created_chat = entity_create('node', $chatcreation);
$created_chat->save();

$chat_id = $created_chat->nid->value;

//create message

$subject = 'User Comment ID '.htmlspecialchars($userID_current, ENT_QUOTES, 'UTF-8');
$chatmessage = '

'.htmlspecialchars($_POST['text'], ENT_QUOTES, 'UTF-8').'

';

$values = [
'entity_type' => 'node',
'entity_id' => $chat_id,
'field_name' => 'comment',
'uid' => $userID_current,
'comment_type' => 'comment',
'subject' => $subject,
'comment_body' => strip_tags($chatmessage),
'status' => 1
];

$comment = Comment::create($values);
$comment->save();

//create message

}

//create chat

$custom_url = $GLOBALS['base_url'].'/buchungerfolgreich';
#drupal_set_message(t("Deine Buchung wurde erfolgreich durchgeführt."), 'status');
echo $custom_url;

}else{
echo 'ok';
}
die();
}

public function saveappointment(){

@$user_current = \Drupal::currentUser()->id();
@$user_info_current = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
$userID_current = $user_info_current->uid->value;

$query = \Drupal::entityQuery('node');
$query->accessCheck(TRUE);
$query->condition('type', array('calendar_main'), 'IN');
$query->condition('status', 1);
$query->condition('uid', intval($_POST['owner']));
$query->sort('nid', 'DESC');
$entity_ids = $query->execute();

$entity_ids = reset($entity_ids);

if(isset($_POST['mykalendarpage']) && intval($_POST['mykalendarpage']) == 1){
$name_appointment = 'Termin '.$this->counterappointments($entity_ids);
}else{
$name_appointment = 'Buchung '.$this->counterappointments($entity_ids);
}

$appointment_data = array();
$appointment_data['type'] = 'calendar_entries';
$appointment_data['uid'] = intval($userID_current);
$appointment_data['title'] = $name_appointment;
$appointment_data['body'] = $_POST['text'];
$appointment_data['field_calendar_selected_date'] = $_POST['date_format'];
$appointment_data['field_calendar_selected_hour'] = $_POST['hour'];
$appointment_data['field_calendar_id_assoc'] = intval($entity_ids);
$appointment_data['field_calendar_entry_key'] = $_POST['date_format'].'>'.$_POST['hour'].'>'.$entity_ids;
$appointment_data['field_calendar_entry_type'] = $_POST['type'];

$appointment_data['status'] = 1;

$created_appointment = entity_create('node', $appointment_data);
$created_appointment->save();

$appointment_id = $created_appointment->nid->value;
$load_calendar = Node::load(intval($entity_ids));

$array_apppintments = array();
foreach ($load_calendar->get('field_calendar_entry_assoc')->getValue() as $key => $value) {
$appointmentload = Node::load(intval($value['target_id']));
if(!is_object($appointmentload)){

}else{
$array_apppintments[] = $value['target_id'];
}
}
$load_calendar->field_calendar_entry_assoc = $array_apppintments;
$load_calendar->save();

$load_calendar = Node::load(intval($entity_ids));
$appointment_list_data = $load_calendar->get('field_calendar_entry_assoc')->getValue();

if (empty($appointment_list_data)) {
$load_calendar->field_calendar_entry_assoc[0] = $appointment_id;
$load_calendar->save();
} elseif(!empty($appointment_list_data)) {
$appointment_count = count($appointment_list_data);
$load_calendar->field_calendar_entry_assoc[$appointment_count] = $appointment_id;
$load_calendar->save();
}

if(intval($userID_current) != intval($_POST['owner'])){

//email send
$custom_mails = new CemailController();

$current_user = \Drupal\user\Entity\User::load($userID_current);
$owner_kalendar = \Drupal\user\Entity\User::load(intval($_POST['owner']));
$custom_mails->userbookedmail($current_user);
$custom_mails->teacherbookedmail($owner_kalendar);
//email send

//create chat

//chat validation
$query = \Drupal::entityQuery('node');
$query->accessCheck(TRUE);
$query->condition('type', array('chat_content'), 'IN');
$query->condition('status', 1);
$query->condition('field_chat_user_from', array($userID_current),"IN");
$query->condition('field_chat_user_to', array($_POST['owner']),"IN");
$query->sort('nid', 'DESC');
$entity_ids = $query->execute();

$query_second = \Drupal::entityQuery('node');
$query_second->accessCheck(TRUE);
$query_second->condition('type', array('chat_content'), 'IN');
$query_second->condition('status', 1);
$query_second->condition('field_chat_user_from', array($_POST['owner']),"IN");
$query_second->condition('field_chat_user_to', array($userID_current),"IN");
$query_second->sort('nid', 'DESC');
$entity_ids_second = $query_second->execute();
//chat validation

if(!empty($entity_ids)){

//create message

$subject = 'User Comment ID '.htmlspecialchars($userID_current, ENT_QUOTES, 'UTF-8');
$chatmessage = '

'.htmlspecialchars($_POST['text'], ENT_QUOTES, 'UTF-8').'

';

$values = [
'entity_type' => 'node',
'entity_id' => end($entity_ids),
'field_name' => 'comment',
'uid' => $userID_current,
'comment_type' => 'comment',
'subject' => $subject,
'comment_body' => strip_tags($chatmessage),
'status' => 1
];

$comment = Comment::create($values);
$comment->save();

//create message

echo $GLOBALS['base_url'].'/buchungerfolgreich';
die();
}elseif(!empty($entity_ids_second)){

//create message

$subject = 'User Comment ID '.htmlspecialchars($userID_current, ENT_QUOTES, 'UTF-8');
$chatmessage = '

'.htmlspecialchars($_POST['text'], ENT_QUOTES, 'UTF-8').'

';

$values = [
'entity_type' => 'node',
'entity_id' => end($entity_ids_second),
'field_name' => 'comment',
'uid' => $userID_current,
'comment_type' => 'comment',
'subject' => $subject,
'comment_body' => strip_tags($chatmessage),
'status' => 1
];

$comment = Comment::create($values);
$comment->save();

//create message

echo $GLOBALS['base_url'].'/buchungerfolgreich';
die();
}else{
$chatcreation = array();
$chatcreation['type'] = 'chat_content';
$chatcreation['uid'] = intval($userID_current);
$chatcreation['title'] = "Chat between: ID-".$userID_current." and ID-".$_POST['owner'];
$chatcreation['body'] = "Chat between: ID-".$userID_current." and ID-".$_POST['owner'];
$chatcreation['field_chat_user_from'] = $userID_current;
$chatcreation['field_chat_user_to'] = $_POST['owner'];
$chatcreation['status'] = 1;

#$created_chat = entity_create('node', $chatcreation);
#$created_chat->save();
\Drupal::entityTypeManager()->getStorage('node')->create($chatcreation);
$created_chat->save();

$chat_id = $created_chat->nid->value;

//create message

$subject = 'User Comment ID '.htmlspecialchars($userID_current, ENT_QUOTES, 'UTF-8');
$chatmessage = '

'.htmlspecialchars($_POST['text'], ENT_QUOTES, 'UTF-8').'

';

$values = [
'entity_type' => 'node',
'entity_id' => $chat_id,
'field_name' => 'comment',
'uid' => $userID_current,
'comment_type' => 'comment',
'subject' => $subject,
'comment_body' => strip_tags($chatmessage),
'status' => 1
];

$comment = Comment::create($values);
$comment->save();

//create message

}

//create chat

$custom_url = $GLOBALS['base_url'].'/buchungerfolgreich';
#+drupal_set_message(t("Der Termin wurde erfolgreich gebucht."), 'status');
echo $custom_url;

}else{
echo 'ok';
}
die();
}

public function x_week_range($date) {
$ts = strtotime($date);

if(date('D', $ts) === 'Mon'){
$start = (date('w', $ts) == 0) ? $ts : strtotime('monday', $ts);
}else{
$start = (date('w', $ts) == 0) ? $ts : strtotime('last monday', $ts);
}

return array(date('Y-m-d', $start),
date('Y-m-d', strtotime('next sunday', $start)));
}

AnhangGröße
Bild_2023-09-03_141640656.png212.35 KB
‹ Seite auf Xamp wird nicht geladen Node überschreiben mit dem Inhalt aus der anderen Node ›
  • Anmelden oder Registrieren um Kommentare zu schreiben

jQuery

Eingetragen von schmittrich (170)
am 04.09.2023 - 08:07 Uhr

Evtl. könnte der Fehler etwas mit jQuery zu tun haben. Das wurde ja mit dem Wechsel auf Drupal 10 aus dem Core entfernt. Du könntest versuchen jQuery als externe Bibliothek hinzuzufügen. Entweder mit einem Zusatzmodul oder manuell im Verzeichnis /libraries (Modul libraries muss aktiv sein).

  • Anmelden oder Registrieren um Kommentare zu schreiben

Hallo, Vielen Dank für Ihre

Eingetragen von Rubi_2021 (13)
am 04.09.2023 - 17:47 Uhr

Hallo,
Vielen Dank für Ihre Antwort. Könnten Sie das etwas genauer erklären ?

Bedeutet das, ich muss nur das Modul /libraries installieren ?

Vielen Dank und viele Grüße

  • Anmelden oder Registrieren um Kommentare zu schreiben

Also die Terminbuchung

Eingetragen von Rubi_2021 (13)
am 04.09.2023 - 18:21 Uhr

Also die Terminbuchung funktioniert ja. Es steht dann auch im Kalender. Nur die Seite bleibt so stehen. Es kommt keine Nachricht ‚erfolgreich gebucht‘. Generell funktionieren Nachrichten über den Messenger irgendwie nicht.

  • Anmelden oder Registrieren um Kommentare zu schreiben

Hallo. Der Server liefert

Eingetragen von dsab (40)
am 04.09.2023 - 21:23 Uhr

Hallo. Der Server liefert nichts zurück für die Weiterverarbeitung und meldet laut Screenshot stattdessen den Serverfehler "500". Deswegen geht es vermutlich nicht weiter. Gibt es serverseitige Logs?

  • Anmelden oder Registrieren um Kommentare zu schreiben

Wie genau sehe ich das wo

Eingetragen von Rubi_2021 (13)
am 06.09.2023 - 20:07 Uhr

Wie genau sehe ich das wo serverseitige logs sind ?

  • Anmelden oder Registrieren um Kommentare zu schreiben

Bitte um Hilfe

Eingetragen von Rubi_2021 (13)
am 12.09.2023 - 18:24 Uhr

Möchte mir vielleicht jemand helfen ? Ich habs immernoch nicht hinbekommen.

  • Anmelden oder Registrieren um Kommentare zu schreiben

Rubi_2021 schriebWie genau

Eingetragen von dsab (40)
am 13.09.2023 - 17:06 Uhr
Rubi_2021 schrieb

Wie genau sehe ich das wo serverseitige logs sind ?

Die sind auf dem Server kalendra.net. Einmal unter Apache-Logs nachschauen. Ebenso unter PHP-Logs. Habe soeben die URL https://kalendra.net/saveappointmentsuser eingegeben und 404 bekommen. Die Route scheint es nicht zu geben.

  • Anmelden oder Registrieren um Kommentare zu schreiben

Benutzeranmeldung

  • Registrieren
  • Neues Passwort anfordern

Aktive Forenthemen

  • Grundsatzfrage
  • Drupal 9 Hosting
  • Seite auf Xamp wird nicht geladen
  • Anregung für die Installation von Drupal
  • [simplenews_stats] [D10] Keine Öffnungen/Ansichten der Newsletter werden gezählt
  • Theme Olivero - Rand entfernen?
  • Olivero veraendern
  • Upgrade Drupal 9 auf 10
  • Matomo(?) in Seite, aber Deinstalliert!
  • Upgrade Drupal 7 auf Drupal 9 / Inhalt erstellen zeigt nur Fehler an
  • Fehlermeldung nach Update auf Drupal 10
  • Wie Button erstellen?
Weiter

Neue Kommentare

  • Dschungel triffts ganz gut
    vor 7 Stunden 16 Minuten
  • Grundsatzfrage
    vor 1 Tag 3 Stunden
  • Schlichte Antwort: Ja, das
    vor 1 Tag 4 Stunden
  • Hallo! Welchen Host nutzt du
    vor 2 Tagen 9 Stunden
  • Also bei mir funktioniert es
    vor 2 Tagen 10 Stunden
  • Hat mir auch sehr geholfen,
    vor 2 Tagen 10 Stunden
  • Releases Stand 20-9-2023
    vor 3 Tagen 18 Stunden
  • Hi, Das ist leider nicht das
    vor 4 Tagen 13 Stunden
  • Wie plötzlich passierte
    vor 5 Tagen 17 Stunden
  • Sowas geht immer mit
    vor 1 Woche 16 Stunden

Statistik

Beiträge im Forum: 248812
Registrierte User: 19837

Neue User:

  • Thorsten Kötter
  • inklusion
  • sofortnovo

» Alle User anzeigen

User nach Punkten sortiert:
wla9334
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3924
ronald3845
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 0 User und 3 Gäste online.

Hauptmenü

  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche

Quicklinks I

  • Infos
  • Drupal Showcase
  • Installation
  • Update
  • Forum
  • Team
  • Verhaltensregeln

Quicklinks II

  • Drupal Jobs
  • FAQ
  • Drupal-Kochbuch
  • Best Practice - Drupal Sites - Guidelines
  • Drupal How To's

Quicklinks III

  • Tipps & Tricks
  • Drupal Theme System
  • Theme Handbuch
  • Leitfaden zur Entwicklung von Modulen

RSS & Twitter

  • Drupal Planet deutsch
  • RSS Feed News
  • RSS Feed Planet
  • Twitter Drupalcenter
Drupalcenter Team | Impressum & Datenschutz | Kontakt
Angetrieben von Drupal | Drupal is a registered trademark of Dries Buytaert.
Drupal Initiative - Drupal Association