PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/models/shortcode.php +2 -2 1.6.8 → 1.8.16 View file →
@@ -173,14 +173,14 @@
173 173 * Creates or updates the specified record.
174 174 *
175 175 * @param object &$data The record to insert.
176 176 *
177 - * @return boolean True if the record has been inserted/updated, otherwise false.
177 + * @return mixed The ID of the inserted record on success, false otherwise.
178 178 */
179 179 public function save(&$data)
180 180 {
181 181 // get old item to get previous shortcode
182 - $old = $this->getItem($data->id);
182 + $old = ($data->id ?? 0) ? $this->getItem($data->id) : null;
183 183
184 184 // save shortcode
185 185 $res = parent::save($data);
186 186