From 657d19518be5be82dab591f038ba6f26e7f56495 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Thu, 27 Apr 2017 16:16:41 -0400 Subject: [PATCH 01/14] Update for Symphony 4.x Update release version. Add data-title attributes to TD elements for mobile version. cc @nitriques --- content/content.index.php | 4 +++- extension.meta.xml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/content/content.index.php b/content/content.index.php index 8e564bf..d42af05 100644 --- a/content/content.index.php +++ b/content/content.index.php @@ -112,10 +112,12 @@ public function view() // Assemble the columns $col_date = Widget::TableData($date); + $col_date->setAttribute('data-title', __('Date')); $col_time = Widget::TableData($time); + $col_time->setAttribute('data-title', __('Time')); $col_desc = Widget::TableData($description, $description_class); - $col_desc->appendChild(Widget::Input("items[{$activity['id']}]", null, 'checkbox')); + $col_desc->setAttribute('data-title', __('Activity')); // Insert the row $tbody[] = Widget::TableRow(array($col_desc, $col_date, $col_time), $row_class, 'activity-' . $activity['id']); diff --git a/extension.meta.xml b/extension.meta.xml index da0e9c7..be2a7ed 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -18,6 +18,9 @@ + + - Update for Symphony 4.x + - Set Author Id to 0 if no author is set (#42) From ab19f7e89663720f4efa42506433122b15f1abc0 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Mon, 1 May 2017 09:36:19 -0400 Subject: [PATCH 02/14] Add icon to ClearAll button. --- content/content.index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/content.index.php b/content/content.index.php index d42af05..9d928bf 100644 --- a/content/content.index.php +++ b/content/content.index.php @@ -19,7 +19,10 @@ public function view() // Add a button to clear all activity, if developer if (Tracker::Author()->isDeveloper()) { $clearform = Widget::Form(Symphony::Engine()->getCurrentPageURL(), 'post'); - $button = new XMLElement('button', __('Clear All')); + $button = new XMLElement( + 'button', + Widget::SVGIcon('close') . '' . __('Clear All') . '' + ); $button->setAttributeArray(array('name' => 'action[clear-all]', 'class' => 'button confirm delete', 'title' => __('Clear all activity'), 'accesskey' => 'd', 'data-message' => __('Are you sure you want to clear all activity?'))); $clearform->appendChild($button); From 6a3de7e03f79c7988a14e3bdd82ce59a76099b86 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 5 May 2017 15:06:12 -0400 Subject: [PATCH 03/14] Add extension custom icon to core Widget::SVGIcon. --- content/content.index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/content.index.php b/content/content.index.php index 9d928bf..cac8916 100644 --- a/content/content.index.php +++ b/content/content.index.php @@ -19,6 +19,10 @@ public function view() // Add a button to clear all activity, if developer if (Tracker::Author()->isDeveloper()) { $clearform = Widget::Form(Symphony::Engine()->getCurrentPageURL(), 'post'); + Widget::registerSVGIcon( + 'close', + '' + ); $button = new XMLElement( 'button', Widget::SVGIcon('close') . '' . __('Clear All') . '' From d5bf58880050bf3de69530e91941729a994d9005 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Thu, 11 May 2017 13:12:22 -0400 Subject: [PATCH 04/14] Format dashboard panel to fit in with new Symphony 4.x layout --- assets/tracker.dashboard.css | 13 ++++--------- extension.driver.php | 7 +++++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/assets/tracker.dashboard.css b/assets/tracker.dashboard.css index a75be9e..74dbeac 100644 --- a/assets/tracker.dashboard.css +++ b/assets/tracker.dashboard.css @@ -1,12 +1,7 @@ -div#dashboard .tracker_log table { - width: 100%; +.tracker_activity .panel-inner { + padding: 0; } -div#dashboard .tracker_log table th, -div#dashboard .tracker_log table td { - padding: 1px 10px 1px 0; +.tracker_activity table { + border: none; } - -div#dashboard .tracker_log table th { - text-align: left; -} \ No newline at end of file diff --git a/extension.driver.php b/extension.driver.php index 7f5474d..4a3c482 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -944,7 +944,7 @@ public function renderPanel($context) // Check to see we are being called in the right context // Dashboard also has `contentExtensionDashboardPanel_Config` which extends `AjaxPage` if (method_exists($page, 'addStylesheetToHead')) { - $page->addStylesheetToHead(URL . '/extensions/tracker/assets/dashboard.css', 'screen', 151); + $page->addStylesheetToHead(URL . '/extensions/tracker/assets/tracker.dashboard.css', 'screen', 151); } $logs = Tracker::fetchActivities($filters, (int) $config['limit'], 0); @@ -989,12 +989,15 @@ public function renderPanel($context) // Assemble the columns $col_date = Widget::TableData($date); + $col_date->setAttribute('data-title', __('Activity')); $col_time = Widget::TableData($time); + $col_time->setAttribute('data-title', __('Date')); $col_desc = Widget::TableData($description); + $col_desc->setAttribute('data-title', __('Time')); // Insert the row if (!is_null($description)) { - $tbody[] = Widget::TableRow(array($col_desc, $col_date, $col_time), ($bOdd ? 'odd' : null)); + $tbody[] = Widget::TableRow(array($col_desc, $col_date, $col_time)); $bOdd = !$bOdd; } From 78a6158c820910a3e392f96fb9d647e3f9795434 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Wed, 17 May 2017 11:01:54 -0400 Subject: [PATCH 05/14] Update php-min/php-max info --- extension.meta.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.meta.xml b/extension.meta.xml index be2a7ed..16dab2a 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -18,7 +18,7 @@ - + - Update for Symphony 4.x From cc12533a5641c034000ea4bba38c7338576b9e5c Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Thu, 24 Aug 2017 16:10:09 -0400 Subject: [PATCH 06/14] SQL and PHP cases PHP true,false,null in lowercase SQL keywords uppercase --- data-sources/data.tracker_activity.php | 2 +- extension.driver.php | 20 ++++++++++---------- lib/class.tracker.php | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/data-sources/data.tracker_activity.php b/data-sources/data.tracker_activity.php index 318334c..98f43d1 100644 --- a/data-sources/data.tracker_activity.php +++ b/data-sources/data.tracker_activity.php @@ -87,7 +87,7 @@ public function execute(array &$param_pool = null) ); // Build the element - $item = new XMLElement('activity', NULL, array( + $item = new XMLElement('activity', null, array( 'type' => $activity['action_type'], 'entry-id' => $activity['item_id'] )); diff --git a/extension.driver.php b/extension.driver.php index 4a3c482..f779ced 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -263,14 +263,14 @@ public function install() { Symphony::Database()->query( "CREATE TABLE IF NOT EXISTS `tbl_tracker_activity` ( - `id` int(11) unsigned NOT NULL auto_increment, - `item_type` varchar(255), - `item_id` varchar(75), - `action_type` varchar(255), - `user_id` int(11), - `timestamp` timestamp, - `fallback_username` varchar(2048), - `fallback_description` varchar(2048), + `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `item_type` VARCHAR(255), + `item_id` VARCHAR(75), + `action_type` VARCHAR(255), + `user_id` INT(11), + `timestamp` TIMESTAMP, + `fallback_username` VARCHAR(2048), + `fallback_description` VARCHAR(2048), PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); @@ -289,8 +289,8 @@ public function update($previousVersion = null) if ($ret && version_compare($previousVersion, '1.7.0', '<')) { $ret = Symphony::Database()->query(" ALTER TABLE `tbl_tracker_activity` - MODIFY `fallback_username` varchar(2048), - MODIFY `fallback_description` varchar(2048); + MODIFY `fallback_username` VARCHAR(2048), + MODIFY `fallback_description` VARCHAR(2048); "); } diff --git a/lib/class.tracker.php b/lib/class.tracker.php index 44ac872..e75ff6c 100644 --- a/lib/class.tracker.php +++ b/lib/class.tracker.php @@ -608,7 +608,7 @@ public static function formatElementItem($activity, $fallback = false) $about = ExtensionManager::about($activity['item_id']); } catch (Exception $e) { - $about = NULL; + $about = null; } if (empty($about)) { $item = $activity['fallback_description']; @@ -652,7 +652,7 @@ public static function formatElementItem($activity, $fallback = false) break; default: - $item = NULL; + $item = null; break; } From 091440e5842616f86e23f133331d525597cd650a Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Wed, 13 Jun 2018 16:43:56 -0400 Subject: [PATCH 07/14] Code refactoring for Database --- extension.driver.php | 59 +++++++++++++++++++++++++++----------------- extension.meta.xml | 1 + 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index f779ced..a031d5f 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -261,20 +261,29 @@ public function getSubscribedDelegates() public function install() { - Symphony::Database()->query( - "CREATE TABLE IF NOT EXISTS `tbl_tracker_activity` ( - `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `item_type` VARCHAR(255), - `item_id` VARCHAR(75), - `action_type` VARCHAR(255), - `user_id` INT(11), - `timestamp` TIMESTAMP, - `fallback_username` VARCHAR(2048), - `fallback_description` VARCHAR(2048), - PRIMARY KEY (`id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); - - return true; + return Symphony::Database() + ->create('tbl_tracker_activity') + ->ifNotExists() + ->charset('utf8') + ->collate('utf8_unicode_ci') + ->fields([ + 'id' => [ + 'type' => 'int(11)', + 'auto' => true, + ], + 'item_type' => 'varchar(255)', + 'item_id' => 'varchar(75)', + 'action_type' => 'varchar(255)', + 'user_id' => 'int(11)', + 'timestamp' => 'timestamp', + 'fallback_username' => 'varchar(2048)', + 'fallback_description' => 'varchar(2048)', + ]) + ->keys([ + 'id' => 'primary', + ]) + ->execute() + ->success(); } public function update($previousVersion = null) @@ -287,11 +296,14 @@ public function update($previousVersion = null) // less than 1.7.0 if ($ret && version_compare($previousVersion, '1.7.0', '<')) { - $ret = Symphony::Database()->query(" - ALTER TABLE `tbl_tracker_activity` - MODIFY `fallback_username` VARCHAR(2048), - MODIFY `fallback_description` VARCHAR(2048); - "); + $ret = Symphony::Database() + ->alter('tbl_tracker_activity') + ->modify([ + 'fallback_username' => 'varchar(2048)', + 'fallback_description' => 'varchar(2048)', + ]) + ->execute() + ->success(); } return $ret; @@ -299,9 +311,12 @@ public function update($previousVersion = null) public function uninstall() { - Symphony::Database()->query( - "DROP TABLE IF EXISTS `tbl_tracker_activity`;" - ); + Symphony::Database() + ->drop('tbl_tracker_activity') + ->ifExists() + ->execute() + ->success(); + Symphony::Configuration()->remove('tracker'); return Symphony::Configuration()->write(); diff --git a/extension.meta.xml b/extension.meta.xml index 16dab2a..edf70ba 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -20,6 +20,7 @@ - Update for Symphony 4.x + - Code refactoring for Database and EQFA - Set Author Id to 0 if no author is set (#42) From c5aaa558d4fd564a22a54665e80807894fac2771 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Thu, 14 Jun 2018 14:42:19 -0400 Subject: [PATCH 08/14] Fix be able to log even if item_id is null (like in the preferences) --- extension.driver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extension.driver.php b/extension.driver.php index a031d5f..538540c 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -272,7 +272,10 @@ public function install() 'auto' => true, ], 'item_type' => 'varchar(255)', - 'item_id' => 'varchar(75)', + 'item_id' => [ + 'type' => 'varchar(75)', + 'null' => true, + ], 'action_type' => 'varchar(255)', 'user_id' => 'int(11)', 'timestamp' => 'timestamp', From a1eeb036e17d81acfe3177c2aa76b28e667039ef Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 15 Jun 2018 09:56:57 -0400 Subject: [PATCH 09/14] Rework the whole $_REQUEST['filter']. Fix forgotten old Database queries. --- content/content.index.php | 42 +++++++++++++--------- extension.meta.xml | 2 +- lib/class.tracker.php | 74 +++++++++++++++++---------------------- 3 files changed, 58 insertions(+), 60 deletions(-) diff --git a/content/content.index.php b/content/content.index.php index cac8916..a874043 100644 --- a/content/content.index.php +++ b/content/content.index.php @@ -49,13 +49,9 @@ public function view() $filters = array(); if (isset($_REQUEST['filter'])) { - - list($column, $value) = explode(':', $_REQUEST['filter'], 2); - $values = explode(',', $value); - $filters[$column] = array(); - - foreach ($values as $value) { - $filters[$column][] = rawurldecode($value); + foreach (explode('-', $_REQUEST['filter']) as $key => $value) { + $filter = explode(':', $value); + $filters[$filter[0]] = explode(',', rawurldecode($filter[1])); } } @@ -154,13 +150,17 @@ public function view() // Append pagination $filter_sql = Tracker::buildFilterSQL($filters); - $sql = ' - SELECT count(id) as `count` - FROM `tbl_tracker_activity`' . - $filter_sql - ; $per_page = Symphony::Configuration()->get('pagination_maximum_rows', 'symphony'); - $total_entries = Symphony::Database()->fetchVar('count', 0, $sql); + $q = Symphony::Database() + ->select(['count(id)' => 'count']) + ->from('tbl_tracker_activity'); + foreach ($filter_sql as $key => $value) { + $q->where([$key => $value]); + } + $total_entries = $q + ->execute() + ->variable('count'); + $remaining_entries = max(0, $total_entries - ($start + $per_page)); $total_pages = max(1, ceil($total_entries * (1 / $per_page))); $remaining_pages = max(0, $total_pages - $current_page); @@ -213,16 +213,24 @@ public function __actionIndex() $checked = @array_keys($_POST['items']); if (@array_key_exists('clear-all', $_POST['action'])) { - $sql = 'TRUNCATE `tbl_tracker_activity`;'; - Symphony::Database()->query($sql); + // $sql = 'TRUNCATE `tbl_tracker_activity`;'; + // Symphony::Database()->query($sql); + Symphony::Database() + ->truncate('tbl_tracker_activity') + ->execute() + ->success(); + redirect(Administration::instance()->getCurrentPageURL()); } elseif (is_array($checked) && !empty($checked)) { switch ($_POST['with-selected']) { case 'delete': - - Symphony::Database()->delete('tbl_tracker_activity', ' `id` IN("' . implode('","',$checked) . '")'); + Symphony::Database() + ->delete('tbl_tracker_activity') + ->where(['id' => ['in' => $checked]]) + ->execute() + ->success(); redirect(Administration::instance()->getCurrentPageURL()); break; diff --git a/extension.meta.xml b/extension.meta.xml index edf70ba..1c8d116 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -1,6 +1,6 @@ - Tracker + Tracker Activity Track user and system activity https://github.com/symphonists/tracker https://github.com/symphonists/tracker/issues diff --git a/lib/class.tracker.php b/lib/class.tracker.php index e75ff6c..215849d 100644 --- a/lib/class.tracker.php +++ b/lib/class.tracker.php @@ -113,24 +113,29 @@ public static function truncateValue($value, $max = 2048) return $value; } - public static function fetchActivities(array $filters,$limit = null, $start = 0, $sort = 'timestamp', $order = 'DESC') + public static function fetchActivities($filters = array(),$limit = null, $start = 0, $sort = 'timestamp', $order = 'DESC') { // Build the filter SQL. $filter_sql = static::buildFilterSQL($filters); // Run the query. - $activities = Symphony::Database()->fetch(' - SELECT - * - FROM - `tbl_tracker_activity`' . - $filter_sql . - ' ORDER BY `' . - $sort . '` ' . $order - . ($limit ? ' LIMIT ' . intval($start) . ', ' . intval($limit) : '') - ); + $q = Symphony::Database() + ->select(['*']) + ->from('tbl_tracker_activity'); + + foreach ($filter_sql as $key => $value) { + $q->where([$key => $value]); + } + + $q->orderBy($sort, $order); - return $activities; + if ($limit !== null) { + $q->limit(intval($limit)); + } + + return $q + ->execute() + ->rows(); } /** @@ -160,54 +165,39 @@ public static function fetchActivities(array $filters,$limit = null, $start = 0, * ); * */ - public static function buildFilterSQL($filters) + public static function buildFilterSQL($filters = array()) { - $columns = Symphony::Database()->fetch('DESCRIBE `tbl_tracker_activity`'); + $columns = Symphony::Database() + ->describe('tbl_tracker_activity') + ->execute() + ->rows(); + foreach($columns as $key => $column) { $columns[$key] = $column['Field']; } - $filter_sql = ''; + $filter_sql = array(); // If we've got a $filters array, let's build the SQL - // TODO: I imagine this can be made more elegant if (!empty($filters) && is_array($filters)) { - $filter_sql .= ' WHERE '; - $i = 0; // Iterate over the field filters foreach($filters as $field => $options) { - // Prevent fatal error when filter field doesn't exist if (!in_array($field,$columns)) { return; } - // If there's more than one field filter - if ($i > 0) { - $filter_sql .= ' AND '; - } - - // Allow custom SQL by passing a string - // TODO: Is this a security concern? - if (!is_array($options)) { - $filter_sql .= '`' . $field . '` ' . $options . ' '; + if (count($options) < 2) { + $filter_sql[$field] = $options[0]; } - - // Iterate over the filter values and group them with OR else { - foreach($options as $num => $option) { - if ($num == 0 && count($options) > 1) { - $filter_sql .= ' ('; - } - if ($num > 0) { - $filter_sql .= ' OR '; - } - $filter_sql .= '`' . $field . '` = "' . $option . '"'; - if (count($options) > 1 && $option == end($options)) { - $filter_sql .= ')'; - } + $opts = array(); + + foreach($options as $option) { + $opts[] = [$field => $option]; } + + $filter_sql['or'] = $opts; } - $i++; } } From 2e59114faf451e6772c9c7b79e0187ece3692779 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 15 Jun 2018 14:47:50 -0400 Subject: [PATCH 10/14] Fix buildFilterSQL when is given an array with empty elements --- lib/class.tracker.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/class.tracker.php b/lib/class.tracker.php index 215849d..a999b44 100644 --- a/lib/class.tracker.php +++ b/lib/class.tracker.php @@ -184,7 +184,9 @@ public static function buildFilterSQL($filters = array()) // Iterate over the field filters foreach($filters as $field => $options) { // Prevent fatal error when filter field doesn't exist - if (!in_array($field,$columns)) { return; } + if (!in_array($field, $columns)) { + return array(); + } if (count($options) < 2) { $filter_sql[$field] = $options[0]; From ebb5ae4025d07991ab4136298406cd21ec50c7c0 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Tue, 19 Jun 2018 11:29:04 -0400 Subject: [PATCH 11/14] Replace deprecated method fetch() by select() --- extension.driver.php | 10 ++++++++-- extension.meta.xml | 1 + lib/class.tracker.php | 25 +++++++++++++++++++++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index 538540c..34644fd 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -824,7 +824,10 @@ public function appendPreferences($context) $sm = new SectionManager(Administration::instance()); - $sections = $sm->fetch(); + $sections = $sm + ->select() + ->execute() + ->rows(); $excluded_sections = explode(',', Symphony::Configuration()->get('excluded-sections', 'tracker')); if (!empty($sections) && is_array($sections)) { @@ -852,7 +855,10 @@ public function appendPreferences($context) $options = array(); $am = new AuthorManager(Administration::instance()); - $authors = $am->fetch(); + $authors = $am + ->select() + ->execute() + ->rows(); $excluded_authors = explode(',',Symphony::Configuration()->get('excluded-users', 'tracker')); if (!empty($authors) && is_array($authors)) { diff --git a/extension.meta.xml b/extension.meta.xml index 1c8d116..86047fd 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -21,6 +21,7 @@ - Update for Symphony 4.x - Code refactoring for Database and EQFA + - Replace deprecated method fetch() by select() - Set Author Id to 0 if no author is set (#42) diff --git a/lib/class.tracker.php b/lib/class.tracker.php index a999b44..ea4621f 100644 --- a/lib/class.tracker.php +++ b/lib/class.tracker.php @@ -87,7 +87,12 @@ public static function getMemberUsername($member) } else if (!empty($member['section-id']) && !empty($member['id'])) { $sectionID = $member['section-id'] ? $member['section-id'] : extension_Members::getMembersSection(); - $sectionHandle = SectionManager::fetch($sectionID)->get('handle'); + $sectionHandle = (new SectionManager) + ->select() + ->section($sectionID) + ->execute() + ->next() + ->get('handle'); $link = SYMPHONY_URL . '/publish/' . $sectionHandle . '/edit/' . $member['id'] . '/'; $name = $member['username'] ? $member['username'] : $member['email']; @@ -310,9 +315,17 @@ public static function getDescription(array $activity) public static function formatEntryItem($activity, $fallback = false) { // Fetch the entry and its section - $entry = EntryManager::fetch($activity['item_id']); + $entry = (new EntryManager) + ->select() + ->entry($activity['item_id']) + ->execute() + ->next(); $entry = $entry[0]; - $section = SectionManager::fetch($activity['item_type']); + $section = (new SectionManager) + ->select() + ->section($activity['item_type']) + ->execute() + ->next(); // If the entry no longer exists, get the fallback entry description if (!($entry instanceof Entry) || !($section instanceof Section)) { @@ -513,7 +526,11 @@ public static function formatElementItem($activity, $fallback = false) case "sections": // Grab the section info - $section = SectionManager::fetch($activity['item_id']); + $section = (new SectionManager) + ->select() + ->section($activity['item_id']) + ->execute() + ->next(); // If the section no longer exists, use the fallback description if (!($section instanceof Section)) { From 837dafb127c84755eadfc00b4048c80fdcd88ed6 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 22 Jun 2018 11:46:21 -0400 Subject: [PATCH 12/14] Permit null user_id --- extension.driver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extension.driver.php b/extension.driver.php index 34644fd..b4c3fab 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -277,7 +277,10 @@ public function install() 'null' => true, ], 'action_type' => 'varchar(255)', - 'user_id' => 'int(11)', + 'user_id' => [ + 'type' => 'int(11)', + 'null' => true, + ], 'timestamp' => 'timestamp', 'fallback_username' => 'varchar(2048)', 'fallback_description' => 'varchar(2048)', From 7ca2355ead6c4a613d68e630c423016061d46bc8 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Mon, 9 Jul 2018 13:56:42 -0400 Subject: [PATCH 13/14] Fix unknown entry informations. --- lib/class.tracker.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/class.tracker.php b/lib/class.tracker.php index ea4621f..c009de6 100644 --- a/lib/class.tracker.php +++ b/lib/class.tracker.php @@ -318,9 +318,11 @@ public static function formatEntryItem($activity, $fallback = false) $entry = (new EntryManager) ->select() ->entry($activity['item_id']) + ->section($activity['item_type']) + ->includeAllFields() ->execute() ->next(); - $entry = $entry[0]; + $section = (new SectionManager) ->select() ->section($activity['item_type']) From 0ac513ff4be64526889c4217ce9714f30ec755cf Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Tue, 18 Dec 2018 09:48:49 -0500 Subject: [PATCH 14/14] Remote SQL collate and charset definitions. --- extension.driver.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index b4c3fab..369d990 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -264,8 +264,6 @@ public function install() return Symphony::Database() ->create('tbl_tracker_activity') ->ifNotExists() - ->charset('utf8') - ->collate('utf8_unicode_ci') ->fields([ 'id' => [ 'type' => 'int(11)',