From 8de2595c1ba3efad49bf1cdceab2e28a83f5fb68 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Thu, 10 Oct 2019 19:07:55 +0200 Subject: [PATCH 01/13] add fields to contact menu --- installation/sql/mysql/joomla.sql | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 3fc0212e5c53a..d3d151d380e28 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -1322,7 +1322,7 @@ CREATE TABLE IF NOT EXISTS `#__menu` ( -- INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) VALUES -(1, '', 'Menu_Item_Root', 'root', '', '', '', '', 1, 0, 0, 0, 0, NULL, 0, 0, '', 0, '', 0, 37, 0, '*', 0, NULL, NULL); +(1, '', 'Menu_Item_Root', 'root', '', '', '', '', 1, 0, 0, 0, 0, NULL, 0, 0, '', 0, '', 0, 41, 0, '*', 0, NULL, NULL); INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 2, 'main', 'com_banners', 'Banners', '', 'Banners', 'index.php?option=com_banners', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:banners', 0, '', 1, 10, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_banners'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) @@ -1334,33 +1334,38 @@ SELECT 5, 'main', 'com_banners_clients', 'Clients', '', 'Banners/Clients', 'inde INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 6, 'main', 'com_banners_tracks', 'Tracks', '', 'Banners/Tracks', 'index.php?option=com_banners&view=tracks', 'component', 1, 2, 2, `extension_id`, 0, NULL, 0, 0, 'class:banners-tracks', 0, '', 8, 9, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_banners'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 7, 'main', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:contact', 0, '', 11, 16, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_contact'; +SELECT 7, 'main', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:contact', 0, '', 11, 20, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_contact'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 8, 'main', 'com_contact_contacts', 'Contacts', '', 'Contacts/Contacts', 'index.php?option=com_contact&view=contacts', 'component', 1, 7, 2, `extension_id`, 0, NULL, 0, 0, 'class:contact', 0, '', 12, 13, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_contact'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 9, 'main', 'com_contact_categories', 'Categories', '', 'Contacts/Categories', 'index.php?option=com_categories&view=categories&extension=com_contact', 'component', 1, 7, 2, `extension_id`, 0, NULL, 0, 0, 'class:contact-cat', 0, '', 14, 15, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_categories'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 10, 'main', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:messages', 0, '', 17, 20, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_messages'; +SELECT 10, 'main', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:messages', 0, '', 21, 24, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_messages'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 11, 'main', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 1, 10, 2, `extension_id`, 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_messages'; +SELECT 11, 'main', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 1, 10, 2, `extension_id`, 0, NULL, 0, 0, 'class:messages-add', 0, '', 22, 23, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_messages'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 12, 'main', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:newsfeeds', 0, '', 21, 26, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_newsfeeds'; +SELECT 12, 'main', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:newsfeeds', 0, '', 25, 30, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_newsfeeds'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 13, 'main', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds&view=newsfeeds', 'component', 1, 12, 2, `extension_id`, 0, NULL, 0, 0, 'class:newsfeeds', 0, '', 22, 23, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_newsfeeds'; +SELECT 13, 'main', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds&view=newsfeeds', 'component', 1, 12, 2, `extension_id`, 0, NULL, 0, 0, 'class:newsfeeds', 0, '', 26, 27, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_newsfeeds'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 14, 'main', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&view=categories&extension=com_newsfeeds', 'component', 1, 12, 2, `extension_id`, 0, NULL, 0, 0, 'class:newsfeeds-cat', 0, '', 24, 25, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_categories'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 15, 'main', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder&view=index', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:finder', 0, '', 27, 28, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_finder'; +SELECT 15, 'main', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder&view=index', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:finder', 0, '', 28, 29, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_finder'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 16, 'main', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags&view=tags', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 1, 'class:tags', 0, '', 29, 30, 0, '', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_tags'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 17, 'main', 'com_associations', 'Multilingual Associations', '', 'Multilingual Associations', 'index.php?option=com_associations&view=associations', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 0, 'class:associations', 0, '', 31, 32, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_associations'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 18, 'main', 'com_messages_manager', 'Private Messages', '', 'Messaging/Private Messages', 'index.php?option=com_messages&view=messages', 'component', 1, 10, 2, `extension_id`, 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_messages'; +SELECT 18, 'main', 'com_messages_manager', 'Private Messages', '', 'Messaging/Private Messages', 'index.php?option=com_messages&view=messages', 'component', 1, 10, 2, `extension_id`, 0, NULL, 0, 0, 'class:messages-add', 0, '', 33, 34, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_messages'; +INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) +SELECT 19, 'main', 'mod_menu_fields', 'Contact Custom Fields', '', 'contact/Custom Fields', 'index.php?option=com_fields&context=com_contact.contact', 'component', 1, 7, 2, `extension_id`, 0, NULL, 0, 0, 'class:messages-add', 0, '', 16, 17, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_fields'; +INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) +SELECT 20, 'main', 'mod_menu_fields_group', 'Contact Custom Fields Group', '', 'contact/Custom Fields Group', 'index.php?option=com_fields&view=groups&context=com_contact.contact', 'component', 1, 7, 2, `extension_id`, 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_fields'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 35, 36, 1, '*', 0, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_content'; + -- -------------------------------------------------------- -- From da7f3154a98cb0f2683186e895c636ec3f8ee56c Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Thu, 10 Oct 2019 19:12:29 +0200 Subject: [PATCH 02/13] grr --- installation/sql/mysql/joomla.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index d3d151d380e28..a20a0f9d8cc38 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -1362,7 +1362,7 @@ SELECT 19, 'main', 'mod_menu_fields', 'Contact Custom Fields', '', 'contact/Cust INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) SELECT 20, 'main', 'mod_menu_fields_group', 'Contact Custom Fields Group', '', 'contact/Custom Fields Group', 'index.php?option=com_fields&view=groups&context=com_contact.contact', 'component', 1, 7, 2, `extension_id`, 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_fields'; INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`) -SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 35, 36, 1, '*', 0, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_content'; +SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, `extension_id`, 0, NULL, 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 39, 40, 1, '*', 0, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_content'; From 50c9469663fa57bb7e189587d5fdb1b3decbefc5 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Thu, 10 Oct 2019 19:34:05 +0200 Subject: [PATCH 03/13] recalc lft,rgt --- installation/sql/postgresql/joomla.sql | 30 ++++++++++++++------------ 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index dfb27e67a63e1..bf0b4b701a4b1 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -1324,7 +1324,7 @@ COMMENT ON COLUMN "#__menu"."home" IS 'Indicates if this menu item is the home o -- INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") VALUES -(1, '', 'Menu_Item_Root', 'root', '', '', '', '', 1, 0, 0, 0, 0, NULL, 0, 0, '', 0, '', 0, 37, 0, '*', 0, NULL, NULL); +(1, '', 'Menu_Item_Root', 'root', '', '', '', '', 1, 0, 0, 0, 0, NULL, 0, 0, '', 0, '', 0, 41, 0, '*', 0, NULL, NULL); INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") SELECT 2, 'main', 'com_banners', 'Banners', '', 'Banners', 'index.php?option=com_banners', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:banners', 0, '', 1, 10, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_banners'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") @@ -1336,33 +1336,35 @@ SELECT 5, 'main', 'com_banners_clients', 'Clients', '', 'Banners/Clients', 'inde INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") SELECT 6, 'main', 'com_banners_tracks', 'Tracks', '', 'Banners/Tracks', 'index.php?option=com_banners&view=tracks', 'component', 1, 2, 2, "extension_id", 0, NULL, 0, 0, 'class:banners-tracks', 0, '', 8, 9, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_banners'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 7, 'main', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:contact', 0, '', 11, 16, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_contact'; +SELECT 7, 'main', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:contact', 0, '', 11, 20, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_contact'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") SELECT 8, 'main', 'com_contact_contacts', 'Contacts', '', 'Contacts/Contacts', 'index.php?option=com_contact&view=contacts', 'component', 1, 7, 2, "extension_id", 0, NULL, 0, 0, 'class:contact', 0, '', 12, 13, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_contact'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") SELECT 9, 'main', 'com_contact_categories', 'Categories', '', 'Contacts/Categories', 'index.php?option=com_categories&view=categories&extension=com_contact', 'component', 1, 7, 2, "extension_id", 0, NULL, 0, 0, 'class:contact-cat', 0, '', 14, 15, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_categories'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 10, 'main', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:messages', 0, '', 17, 20, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_messages'; +SELECT 10, 'main', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:messages', 0, '', 21, 24, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_messages'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 11, 'main', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 1, 10, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_messages'; +SELECT 11, 'main', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 1, 10, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 22, 23, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_messages'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 12, 'main', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:newsfeeds', 0, '', 21, 26, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_newsfeeds'; +SELECT 12, 'main', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:newsfeeds', 0, '', 25, 30, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_newsfeeds'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 13, 'main', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds&view=newsfeeds', 'component', 1, 12, 2, "extension_id", 0, NULL, 0, 0, 'class:newsfeeds', 0, '', 22, 23, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_newsfeeds'; +SELECT 13, 'main', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds&view=newsfeeds', 'component', 1, 12, 2, "extension_id", 0, NULL, 0, 0, 'class:newsfeeds', 0, '', 26, 27, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_newsfeeds'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 14, 'main', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&view=categories&extension=com_newsfeeds', 'component', 1, 12, 2, "extension_id", 0, NULL, 0, 0, 'class:newsfeeds-cat', 0, '', 24, 25, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_categories'; +SELECT 14, 'main', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&view=categories&extension=com_newsfeeds', 'component', 1, 12, 2, "extension_id", 0, NULL, 0, 0, 'class:newsfeeds-cat', 0, '', 28, 29, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_categories'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 15, 'main', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder&view=index', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:finder', 0, '', 27, 28, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_finder'; +SELECT 15, 'main', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder&view=index', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:finder', 0, '', 31, 32, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_finder'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 16, 'main', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags&view=tags', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 1, 'class:tags', 0, '', 29, 30, 0, '', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_tags'; +SELECT 16, 'main', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags&view=tags', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 1, 'class:tags', 0, '', 33, 34, 0, '', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_tags'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 17, 'main', 'com_associations', 'Multilingual Associations', '', 'Multilingual Associations', 'index.php?option=com_associations&view=associations', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:associations', 0, '', 31, 32, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_associations'; +SELECT 17, 'main', 'com_associations', 'Multilingual Associations', '', 'Multilingual Associations', 'index.php?option=com_associations&view=associations', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 0, 'class:associations', 0, '', 35, 36, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_associations'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 18, 'main', 'com_messages_manager', 'Private Messages', '', 'Messaging/Private Messages', 'index.php?option=com_messages&view=messages', 'component', 1, 10, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_messages'; +SELECT 18, 'main', 'com_messages_manager', 'Private Messages', '', 'Messaging/Private Messages', 'index.php?option=com_messages&view=messages', 'component', 1, 10, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 22, 23, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_messages'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 35, 36, 1, '*', 0, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_content'; - - +SELECT 19, 'main', 'mod_menu_fields', 'Contact Custom Fields', '', 'contact/Custom Fields', 'index.php?option=com_fields&context=com_contact.contact', 'component', 1, 7, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 16, 17, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_fields'; +INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") +SELECT 20, 'main', 'mod_menu_fields_group'', 'Contact Custom Fields Group', '', 'contact/Custom Fields Group', 'index.php?option=com_fields&view=groups&context=com_contact.contact', 'component', 1, 7, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_fields'; +INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") +SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 39, 40, 1, '*', 0, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_content'; SELECT setval('#__menu_id_seq', 102, false); -- From aabf13da09c3773a8b1480fcf677a298900a21eb Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Thu, 10 Oct 2019 19:36:12 +0200 Subject: [PATCH 04/13] no need of sidebar --- .../com_contact/Helper/ContactHelper.php | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/administrator/components/com_contact/Helper/ContactHelper.php b/administrator/components/com_contact/Helper/ContactHelper.php index 7f869e1e4e8ce..39e857d4b0694 100644 --- a/administrator/components/com_contact/Helper/ContactHelper.php +++ b/administrator/components/com_contact/Helper/ContactHelper.php @@ -22,29 +22,5 @@ */ class ContactHelper extends ContentHelper { - /** - * Configure the Linkbar. - * - * @param string $vName The name of the active view. - * - * @return void - * - * @since 1.6 - */ - public static function addSubmenu($vName) - { - if (ComponentHelper::isEnabled('com_fields') && ComponentHelper::getParams('com_contact')->get('custom_fields_enable', '1')) - { - \JHtmlSidebar::addEntry( - Text::_('JGLOBAL_FIELDS'), - 'index.php?option=com_fields&context=com_contact.contact', - $vName == 'fields.fields' - ); - \JHtmlSidebar::addEntry( - Text::_('JGLOBAL_FIELD_GROUPS'), - 'index.php?option=com_fields&view=groups&context=com_contact.contact', - $vName == 'fields.groups' - ); - } - } + } From 275781d5e5de8a2bd9e4a2aadbdb1193647728e7 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Thu, 10 Oct 2019 19:49:30 +0200 Subject: [PATCH 05/13] don't need those now --- administrator/components/com_contact/Helper/ContactHelper.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/administrator/components/com_contact/Helper/ContactHelper.php b/administrator/components/com_contact/Helper/ContactHelper.php index 39e857d4b0694..f67fc058bc5cc 100644 --- a/administrator/components/com_contact/Helper/ContactHelper.php +++ b/administrator/components/com_contact/Helper/ContactHelper.php @@ -11,9 +11,7 @@ defined('_JEXEC') or die; -use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Helper\ContentHelper; -use Joomla\CMS\Language\Text; /** * Contact component helper. From c3bffc46382900153948f71e45c502d5ddf66813 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Fri, 11 Oct 2019 08:46:50 +0200 Subject: [PATCH 06/13] CS --- administrator/components/com_contact/Helper/ContactHelper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/administrator/components/com_contact/Helper/ContactHelper.php b/administrator/components/com_contact/Helper/ContactHelper.php index f67fc058bc5cc..7ed31c2811116 100644 --- a/administrator/components/com_contact/Helper/ContactHelper.php +++ b/administrator/components/com_contact/Helper/ContactHelper.php @@ -19,6 +19,5 @@ * @since 1.6 */ class ContactHelper extends ContentHelper -{ - +{ } From b8a29ac7a934e2b98daa6dd54310df8154cf57eb Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Fri, 11 Oct 2019 08:54:15 +0200 Subject: [PATCH 07/13] grr cs --- administrator/components/com_contact/Helper/ContactHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_contact/Helper/ContactHelper.php b/administrator/components/com_contact/Helper/ContactHelper.php index 7ed31c2811116..c53e96f1fcbff 100644 --- a/administrator/components/com_contact/Helper/ContactHelper.php +++ b/administrator/components/com_contact/Helper/ContactHelper.php @@ -19,5 +19,5 @@ * @since 1.6 */ class ContactHelper extends ContentHelper -{ +{ } From b11cc9d93d5bb7874a5450f8d3d37fff9171dc55 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Sun, 13 Oct 2019 10:40:55 +0200 Subject: [PATCH 08/13] postflight --- administrator/components/com_admin/script.php | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 979dd0e0f6187..f3b5b2abfccf6 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -6076,4 +6076,175 @@ private function cleanJoomlaCache() $model->setState('client_id', 1); $model->clean(); } + + /** + * Called after any type of action + * + * @param string $action Which action is happening (install|uninstall|discover_install|update) + * @param Installer $installer The class calling this method + * + * @return boolean True on success + * + * @since 3.7.0 + */ + public function postflight($action, $installer) + { + if ($action !== 'update') + { + return true; + } + + if (empty($this->fromVersion) || version_compare($this->fromVersion, '4.0.0', 'ge')) + { + return true; + } + + $db = Factory::getDbo(); + Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/Table/'); + + $tableItem = new \Joomla\Component\Menus\Administrator\Table\MenuTable($db); + + // Check for the Contact parent Id Menu Item + $keys = [ + 'menutype' => 'main', + 'type' => 'component', + 'title' => 'com_contact', + 'parent_id' => 1, + 'client_id' => 1, + ]; + + $contactMenuitem = $tableItem->load($keys); + + if (!$contactMenuitem) + { + return false; + } + + $parentId = $tableItem->id; + $componentId = ExtensionHelper::getExtensionRecord('com_fields')->extension_id; + + // Add Contact Fields Menu Items. + $menuItems = [ + [ + 'menutype' => 'main', + 'title' => '-', + 'alias' => microtime(true), + 'note' => '', + 'path' => '', + 'link' => '#', + 'type' => 'separator', + 'published' => 1, + 'parent_id' => $parentId, + 'level' => 2, + 'component_id' => $componentId, + 'checked_out' => 0, + 'checked_out_time' => NULL, + 'browserNav' => 0, + 'access' => 0, + 'img' => '', + 'template_style_id' => 0, + 'params' => '{}', + 'home' => 0, + 'language' => '*', + 'client_id' => 1, + 'publish_up' => NULL, + 'publish_down' => NULL, + ], + [ + 'menutype' => 'main', + 'title' => 'mod_menu_fields', + 'alias' => 'Contact Custom Fields', + 'note' => '', + 'path' => 'contact/Custom Fields', + 'link' => 'index.php?option=com_fields&context=com_contact.contact', + 'type' => 'component', + 'published' => 1, + 'parent_id' => $parentId, + 'level' => 2, + 'component_id' => $componentId, + 'checked_out' => 0, + 'checked_out_time' => NULL, + 'browserNav' => 0, + 'access' => 0, + 'img' => '', + 'template_style_id' => 0, + 'params' => '{}', + 'home' => 0, + 'language' => '*', + 'client_id' => 1, + 'publish_up' => NULL, + 'publish_down' => NULL, + ], + [ + 'menutype' => 'main', + 'title' => 'mod_menu_fields_group', + 'alias' => 'Contact Custom Fields Group', + 'note' => '', + 'path' => 'contact/Custom Fields Group', + 'link' => 'index.php?option=com_fields&view=groups&context=com_contact.contact', + 'type' => 'component', + 'published' => 1, + 'parent_id' => $parentId, + 'level' => 2, + 'component_id' => $componentId, + 'checked_out' => 0, + 'checked_out_time' => NULL, + 'browserNav' => 0, + 'access' => 0, + 'img' => '', + 'template_style_id' => 0, + 'params' => '{}', + 'home' => 0, + 'language' => '*', + 'client_id' => 1, + 'publish_up' => NULL, + 'publish_down' => NULL, + ] + ]; + + foreach ($menuItems as $menuItem) + { + // Check an existing record + $keys = [ + 'menutype' => $menuItem['menutype'], + 'type' => $menuItem['type'], + 'title' => $menuItem['title'], + 'parent_id' => $menuItem['parent_id'], + 'client_id' => $menuItem['client_id'], + ]; + + if ($tableItem->load($keys)) + { + continue; + } + $newTableItem = new \Joomla\Component\Menus\Administrator\Table\MenuTable($db); + // Bind the data. + if (!$newTableItem->bind($menuItem)) + { + return false; + } + + $newTableItem->setLocation($menuItem['parent_id'], 'last-child'); + + // Check the data. + if (!$newTableItem->check()) + { + return false; + } + + // Store the data. + if (!$newTableItem->store()) + { + return false; + } + + // Rebuild the tree path. + if (!$newTableItem->rebuildPath($newTableItem->id)) + { + return false; + } + } + + return true; + } } From cae3b3b6830ee806a6eefa0f42b7165a0f38d3c0 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Sun, 13 Oct 2019 10:59:31 +0200 Subject: [PATCH 09/13] Update administrator/components/com_admin/script.php Co-Authored-By: Richard Fath --- administrator/components/com_admin/script.php | 1 + 1 file changed, 1 insertion(+) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index f3b5b2abfccf6..1bc89540d5104 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -6218,6 +6218,7 @@ public function postflight($action, $installer) continue; } $newTableItem = new \Joomla\Component\Menus\Administrator\Table\MenuTable($db); + // Bind the data. if (!$newTableItem->bind($menuItem)) { From 951675c5704c794624b02f6d915d553b4e044e26 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sun, 13 Oct 2019 12:10:33 +0200 Subject: [PATCH 10/13] PHPCS --- administrator/components/com_admin/script.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 1bc89540d5104..8f5cda4ec082b 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -6101,7 +6101,7 @@ public function postflight($action, $installer) $db = Factory::getDbo(); Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/Table/'); - + $tableItem = new \Joomla\Component\Menus\Administrator\Table\MenuTable($db); // Check for the Contact parent Id Menu Item @@ -6138,7 +6138,7 @@ public function postflight($action, $installer) 'level' => 2, 'component_id' => $componentId, 'checked_out' => 0, - 'checked_out_time' => NULL, + 'checked_out_time' => null, 'browserNav' => 0, 'access' => 0, 'img' => '', @@ -6147,8 +6147,8 @@ public function postflight($action, $installer) 'home' => 0, 'language' => '*', 'client_id' => 1, - 'publish_up' => NULL, - 'publish_down' => NULL, + 'publish_up' => null, + 'publish_down' => null, ], [ 'menutype' => 'main', @@ -6163,7 +6163,7 @@ public function postflight($action, $installer) 'level' => 2, 'component_id' => $componentId, 'checked_out' => 0, - 'checked_out_time' => NULL, + 'checked_out_time' => null, 'browserNav' => 0, 'access' => 0, 'img' => '', @@ -6172,8 +6172,8 @@ public function postflight($action, $installer) 'home' => 0, 'language' => '*', 'client_id' => 1, - 'publish_up' => NULL, - 'publish_down' => NULL, + 'publish_up' => null, + 'publish_down' => null, ], [ 'menutype' => 'main', @@ -6188,7 +6188,7 @@ public function postflight($action, $installer) 'level' => 2, 'component_id' => $componentId, 'checked_out' => 0, - 'checked_out_time' => NULL, + 'checked_out_time' => null, 'browserNav' => 0, 'access' => 0, 'img' => '', @@ -6197,8 +6197,8 @@ public function postflight($action, $installer) 'home' => 0, 'language' => '*', 'client_id' => 1, - 'publish_up' => NULL, - 'publish_down' => NULL, + 'publish_up' => null, + 'publish_down' => null, ] ]; From 1e5b175333134ff136044d0604fbb2345f8594c2 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Sun, 13 Oct 2019 12:23:48 +0200 Subject: [PATCH 11/13] Update administrator/components/com_admin/script.php Co-Authored-By: Richard Fath --- administrator/components/com_admin/script.php | 1 + 1 file changed, 1 insertion(+) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 8f5cda4ec082b..06a4e15eb63fd 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -6217,6 +6217,7 @@ public function postflight($action, $installer) { continue; } + $newTableItem = new \Joomla\Component\Menus\Administrator\Table\MenuTable($db); // Bind the data. From fa12b15cb9ef265c09d9d293f02d91fd5e2df5a9 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sun, 13 Oct 2019 13:11:14 +0200 Subject: [PATCH 12/13] Fix postgresql/joomla.sql --- installation/sql/postgresql/joomla.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 702bd81761498..af0f9de5b40d1 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -1362,7 +1362,7 @@ SELECT 18, 'main', 'com_messages_manager', 'Private Messages', '', 'Messaging/Pr INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") SELECT 19, 'main', 'mod_menu_fields', 'Contact Custom Fields', '', 'contact/Custom Fields', 'index.php?option=com_fields&context=com_contact.contact', 'component', 1, 7, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 16, 17, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_fields'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") -SELECT 20, 'main', 'mod_menu_fields_group'', 'Contact Custom Fields Group', '', 'contact/Custom Fields Group', 'index.php?option=com_fields&view=groups&context=com_contact.contact', 'component', 1, 7, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_fields'; +SELECT 20, 'main', 'mod_menu_fields_group', 'Contact Custom Fields Group', '', 'contact/Custom Fields Group', 'index.php?option=com_fields&view=groups&context=com_contact.contact', 'component', 1, 7, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_fields'; INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, "extension_id", 0, NULL, 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 39, 40, 1, '*', 0, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_content'; SELECT setval('#__menu_id_seq', 102, false); From b946db937c1091969991287df55a5e284f6cf9a1 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Mon, 14 Oct 2019 09:30:49 +0200 Subject: [PATCH 13/13] Update administrator/components/com_admin/script.php Co-Authored-By: Quy --- administrator/components/com_admin/script.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 06a4e15eb63fd..3a070647a39a2 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -6085,7 +6085,7 @@ private function cleanJoomlaCache() * * @return boolean True on success * - * @since 3.7.0 + * @since __DEPLOY_VERSION__ */ public function postflight($action, $installer) {