PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
← All changes | app/Repositories/ItineraryRepository.php +9 -0 3.0.7 → 3.0.16 View file →
@@ -33,8 +33,17 @@
33 33 * @throws \InvalidArgumentException If day exists and $allowExisting is false
34 34 */
35 35 public function getOrCreateDay(int $tripId, int $dayNumber, ?string $dayTitle = null, ?string $dayDescription = null, bool $allowExisting = true): int
36 36 {
37 + // The method body uses $wpdb and $tableDays directly for the day
38 + // update/insert below. The cached-query closures declare their own copies,
39 + // but the body never did — so $wpdb was null ("Call to a member function
40 + // update() on null") and $tableDays was empty ("Incorrect table name '')".
41 + // This broke saving an activity onto an existing, titled day and silently
42 + // mis-created new days. Declare both here.
43 + global $wpdb;
44 + $tableDays = TripItineraryDaysTable::getTableName();
45 +
37 46 // Use QueryCache for caching day existence checks
38 47 $cacheKey = Cache::KEY_DAY_EXISTS . "_{$tripId}_day_{$dayNumber}";
39 48
40 49 $existingDay = $this->cacheQueryResult($cacheKey, function() use ($tripId, $dayNumber) {