Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pr/16187' into 3.x
Browse files Browse the repository at this point in the history
* upstream/pr/16187:
  Drop all the deprecated columns in a single statement
  Remove deprecated fields from modResource
  • Loading branch information
Mark-H committed Feb 10, 2024
2 parents 73bfd27 + 9ad5f39 commit 7a54b6e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 38 deletions.
1 change: 1 addition & 0 deletions core/docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ development release, and is only shown to give an idea of what's currently in th

MODX Revolution 3.0.3-pl (January 17, 2023)
====================================
- Remove deprecated resource fields privateweb, privatemgr, donthit (#16174)
- Fix cache_resource_clear_partial functionality (#16346)
- Add new error reporting for grids (#16331)
- Fix Validation Error When Switching TV Types (#16319)
Expand Down
5 changes: 1 addition & 4 deletions core/model/schema/modx.mysql.schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,6 @@
<field key="publishedon" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" />
<field key="publishedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
<field key="menutitle" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
<field key="donthit" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
<field key="privateweb" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
<field key="privatemgr" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
<field key="content_dispo" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" />
<field key="hidemenu" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
<field key="class_key" dbtype="varchar" precision="100" phptype="string" null="false" default="MODX\Revolution\modDocument" index="index" />
Expand Down Expand Up @@ -1146,7 +1143,7 @@
<composite alias="TemplateVarResourceGroups" class="MODX\Revolution\modTemplateVarResourceGroup" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
<validation>
<rule field="name" name="invalid" type="preg_match" rule="/^(?!\s)[a-zA-Z0-9\x2d-\x2f\x7f-\xff-_\s]+(?&lt;!\s)$/" message="tv_err_invalid_name" />
<rule field="name" name="reserved" type="preg_match" rule="/^(?!(id|type|pagetitle|longtitle|description|alias|alias_visible|link_attributes|published|pub_date|unpub_date|parent|isfolder|introtext|content|richtext|template|menuindex|searchable|cacheable|createdby|createdon|editedby|editedon|deleted|deletedby|deletedon|publishedon|publishedby|menutitle|donthit|privateweb|privatemgr|content_dispo|hidemenu|class_key|context_key|content_type|uri|uri_override|hide_children_in_tree|show_in_tree|properties)$)/" message="tv_err_reserved_name" />
<rule field="name" name="reserved" type="preg_match" rule="/^(?!(id|type|pagetitle|longtitle|description|alias|alias_visible|link_attributes|published|pub_date|unpub_date|parent|isfolder|introtext|content|richtext|template|menuindex|searchable|cacheable|createdby|createdon|editedby|editedon|deleted|deletedby|deletedon|publishedon|publishedby|menutitle|content_dispo|hidemenu|class_key|context_key|content_type|uri|uri_override|hide_children_in_tree|show_in_tree|properties)$)/" message="tv_err_reserved_name" />
</validation>
</object>

Expand Down
3 changes: 0 additions & 3 deletions core/src/Revolution/modResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
* @property int $publishedon The UNIX time that this Resource was marked as published
* @property int $publishedby The User that published this Resource
* @property string $menutitle The title to show when this Resource is displayed in a menu
* @property boolean $donthit Deprecated.
* @property boolean $privateweb Deprecated.
* @property boolean $privatemgr Deprecated.
* @property int $content_dispo The type of Content Disposition that is used when displaying this Resource
* @property boolean $hidemenu Whether or not this Resource should show in menus
* @property string $class_key The Class Key of this Resource. Useful for derivative Resource types
Expand Down
30 changes: 0 additions & 30 deletions core/src/Revolution/mysql/modResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class modResource extends \MODX\Revolution\modResource
'publishedon' => 0,
'publishedby' => 0,
'menutitle' => '',
'donthit' => 0,
'privateweb' => 0,
'privatemgr' => 0,
'content_dispo' => 0,
'hidemenu' => 0,
'class_key' => 'MODX\\Revolution\\modDocument',
Expand Down Expand Up @@ -307,33 +304,6 @@ class modResource extends \MODX\Revolution\modResource
'null' => false,
'default' => '',
),
'donthit' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'attributes' => 'unsigned',
'phptype' => 'boolean',
'null' => false,
'default' => 0,
),
'privateweb' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'attributes' => 'unsigned',
'phptype' => 'boolean',
'null' => false,
'default' => 0,
),
'privatemgr' =>
array (
'dbtype' => 'tinyint',
'precision' => '1',
'attributes' => 'unsigned',
'phptype' => 'boolean',
'null' => false,
'default' => 0,
),
'content_dispo' =>
array (
'dbtype' => 'tinyint',
Expand Down
2 changes: 1 addition & 1 deletion core/src/Revolution/mysql/modTemplateVar.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class modTemplateVar extends \MODX\Revolution\modTemplateVar
'reserved' =>
array (
'type' => 'preg_match',
'rule' => '/^(?!(id|type|pagetitle|longtitle|description|alias|alias_visible|link_attributes|published|pub_date|unpub_date|parent|isfolder|introtext|content|richtext|template|menuindex|searchable|cacheable|createdby|createdon|editedby|editedon|deleted|deletedby|deletedon|publishedon|publishedby|menutitle|donthit|privateweb|privatemgr|content_dispo|hidemenu|class_key|context_key|content_type|uri|uri_override|hide_children_in_tree|show_in_tree|properties)$)/',
'rule' => '/^(?!(id|type|pagetitle|longtitle|description|alias|alias_visible|link_attributes|published|pub_date|unpub_date|parent|isfolder|introtext|content|richtext|template|menuindex|searchable|cacheable|createdby|createdon|editedby|editedon|deleted|deletedby|deletedon|publishedon|publishedby|menutitle|content_dispo|hidemenu|class_key|context_key|content_type|uri|uri_override|hide_children_in_tree|show_in_tree|properties)$)/',
'message' => 'tv_err_reserved_name',
),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* Scripts removes deprecated fields from the main resource table
*
* @var modX $modx
* @package setup
*/

use MODX\Revolution\modResource;

$class = modResource::class;
$table = $modx->getTableName($class);
$sql = "ALTER TABLE {$modx->escape($table)}
DROP COLUMN `privateweb`,
DROP COLUMN `privatemgr`,
DROP COLUMN `donthit`;";
$modx->exec($sql);
11 changes: 11 additions & 0 deletions setup/includes/upgrades/mysql/3.1.0-pl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Specific upgrades for Revolution 3.1.0-pl
*
* @var modX $modx
* @package setup
* @subpackage upgrades
*/

/* run upgrades common to all db platforms */
include dirname(__DIR__) . '/common/3.1.0-remove-deprecated-resource-fields.php';

0 comments on commit 7a54b6e

Please sign in to comment.