Skip to content

Commit

Permalink
Merge branch 'hotfix-1.2.x' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
satkinson committed May 8, 2025
2 parents 3db492f + d8ba69d commit 11f0a76
Show file tree
Hide file tree
Showing 4,568 changed files with 202,614 additions and 102,479 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": ">=7.3",
"cakephp/cakephp": "^4.4",
"cakephp/cakephp": "^4.6",
"cakephp/migrations": "^3.2",
"cakephp/plugin-installer": "^1.3",
"components/jquery": "~3.7",
Expand Down
1,341 changes: 693 additions & 648 deletions app/composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/config/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.2.2
6 changes: 6 additions & 0 deletions app/resources/locales/en_US/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ msgstr "Incorrect arguments provided to {0}"
msgid "match.er.attr.req"
msgstr "Required attribute {0} not found in request"

msgid "match.er.attrmap.unknown"
msgstr "Unknown Attribute Map {0}"

msgid "match.er.bl.line"
msgstr "Error at line {0}: {1}"

Expand Down Expand Up @@ -354,6 +357,9 @@ msgstr "A Matchgrid with table name {0} already exists"
msgid "match.er.mg.notfound"
msgstr "Matchgrid table not found, was the Matchgrid built? ({0})"

msgid "match.er.mg.rename"
msgstr "A Matchgrid cannot be renamed"

msgid "match.er.mgid"
msgstr "Could not find Matchgrid ID in request"

Expand Down
7 changes: 5 additions & 2 deletions app/src/Command/UpgradeVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ class UpgradeVersionCommand extends Command {
protected $versions = [
"1.0.0" => ['block' => false],
"1.1.0" => ['block' => false],
"1.2.0" => ['block' => false, 'post' => 'post120']
"1.1.1" => ['block' => false],
"1.2.0" => ['block' => false, 'post' => 'post120'],
"1.2.1" => ['block' => false],
"1.2.2" => ['block' => false]
];

// ConsoleIo
Expand Down Expand Up @@ -304,4 +307,4 @@ protected function validateVersions(string $from, string $to): bool {

return true;
}
}
}
2 changes: 1 addition & 1 deletion app/src/Controller/AttributeMappingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function install() {

$this->Flash->success(__('match.rs.AttributeMappings.install'));
}
catch(Exception $e) {
catch(\Exception $e) {
$this->Flash->error($e->getMessage());
}

Expand Down
5 changes: 5 additions & 0 deletions app/src/Model/Table/AttributeMappingsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ public function initialize(array $config): void {
*
* @param int $attributeMapId Attribute Map ID to install into
* @param string $mapping Mapping to install, currently only "nicknames.en" is supported
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/

public function install(int $attributeMapId, string $mapping) {
if($mapping != 'nicknames.en') {
throw new \InvalidArgumentException(__('match.er.attrmap.unknown', $mapping));
}

// For now, we assume this is the CSV file from this project:
// https://github.com/carltonnorthern/nickname-and-diminutive-names-lookup
$infile = fopen(ROOT . DS . "vendor" . DS . "nicknames" . DS . "names.csv", "r");
Expand Down
24 changes: 24 additions & 0 deletions app/src/Model/Table/MatchgridsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ public function buildRules(RulesChecker $rules): RulesChecker {
'isActive',
['errorField' => 'status']);

// The Matchgrid table name cannot be changed once created. For a discussion of
// the complexities of renaming a Matchgrid, see CO-2441.
$rules->addUpdate([$this, 'ruleMatchgridRenamed'],
'matchgridRenamed',
['errorField' => 'table_name']);

return $rules;
}

Expand Down Expand Up @@ -277,6 +283,24 @@ public function ruleIsUnique($entity, array $options): bool|string {

return true;
}

/**
* Application Rule to determine if the Matchgrid is being renamed.
*
* @param Entity $entity Entity to be validated
* @param array $options Application rule options
*
* @return bool|string true if the Rule check passes, false otherwise
* @since COmanage Match v1.2.2
*/

public function ruleMatchgridRenamed($entity, array $options): bool|string {
if($entity->isDirty('table_name')) {
return __('match.er.mg.rename');
}

return true;
}

/**
* Determine if the Matchgrid table exists.
Expand Down
17 changes: 14 additions & 3 deletions app/src/Model/Table/PermissionsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,20 @@ public function buildRules(RulesChecker $rules): RulesChecker {
*/

public function findForUser(string $username) {
return $this->find('list', ['keyField' => 'matchgrid_id', 'valueField' => 'permission'])
->where(['username' => $username])
->toArray();
// As of Cake 4.6 (or maybe 4.5) find('list') keyField can't have null values,
// so we manually assemble the result to an array and assign the platform a pseudo
// identifier of -1.
$perms = $this->find()
->where(['username' => $username])
->all();

$ret = [];

foreach($perms as $p) {
$ret[ $p->matchgrid_id ?? -1 ] = $p->permission;
}

return $ret;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions app/templates/Matchgrids/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ $indexColumns = [
'type' => 'link',
'cssClass' => 'row-link'
],
'description' => [
'type' => 'echo'
],
'status' => [
'type' => 'enum',
'class' => 'StatusEnum'
Expand Down
4 changes: 4 additions & 0 deletions app/templates/Matchgrids/pending.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@

<table>
<tr>
<th><?= __('match.fd.id'); ?></th>
<th><?= __('match.fd.sorid'); ?></th>
<th><?= __('match.fd.sor'); ?></th>
<th><?= __('match.fd.request_time'); ?></th>
</tr>
<?php foreach($vv_pending as $p): ?>
<tr class="linked-row spin">
<td>
<?= $p['id']; ?>
</td>
<td class="row-link">
<?= $this->Html->link(
$p['sorid'],
Expand Down
2 changes: 1 addition & 1 deletion app/templates/email/text/potential_match.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<?php if(is_readable($localTemplate)): ?>
<?php include($localTemplate); ?>
<?php else: ?>
?>

A new potential match is available for your review. You may access the
pending request at this URL:

Expand Down
120 changes: 120 additions & 0 deletions app/vendor/bin/sql-formatter
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/usr/bin/env php
<?php

/**
* Proxy PHP file generated by Composer
*
* This file includes the referenced bin path (../doctrine/sql-formatter/bin/sql-formatter)
* using a stream wrapper to prevent the shebang from being output on PHP<8
*
* @generated
*/

namespace Composer;

$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';

if (PHP_VERSION_ID < 80000) {
if (!class_exists('Composer\BinProxyWrapper')) {
/**
* @internal
*/
final class BinProxyWrapper
{
private $handle;
private $position;
private $realpath;

public function stream_open($path, $mode, $options, &$opened_path)
{
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
$opened_path = substr($path, 17);
$this->realpath = realpath($opened_path) ?: $opened_path;
$opened_path = $this->realpath;
$this->handle = fopen($this->realpath, $mode);
$this->position = 0;

return (bool) $this->handle;
}

public function stream_read($count)
{
$data = fread($this->handle, $count);

if ($this->position === 0) {
$data = preg_replace('{^#!.*\r?\n}', '', $data);
}

$this->position += strlen($data);

return $data;
}

public function stream_cast($castAs)
{
return $this->handle;
}

public function stream_close()
{
fclose($this->handle);
}

public function stream_lock($operation)
{
return $operation ? flock($this->handle, $operation) : true;
}

public function stream_seek($offset, $whence)
{
if (0 === fseek($this->handle, $offset, $whence)) {
$this->position = ftell($this->handle);
return true;
}

return false;
}

public function stream_tell()
{
return $this->position;
}

public function stream_eof()
{
return feof($this->handle);
}

public function stream_stat()
{
return array();
}

public function stream_set_option($option, $arg1, $arg2)
{
return true;
}

public function url_stat($path, $flags)
{
$path = substr($path, 17);
if (file_exists($path)) {
return stat($path);
}

return false;
}
}
}

if (
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/doctrine/sql-formatter/bin/sql-formatter');
exit(0);
}
}

include __DIR__ . '/..'.'/doctrine/sql-formatter/bin/sql-formatter';
5 changes: 4 additions & 1 deletion app/vendor/bin/validate-json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ if (PHP_VERSION_ID < 80000) {
}
}

if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
if (
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/justinrainbow/json-schema/bin/validate-json');
exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/cakephp/cakephp/VERSION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
// @license https://opensource.org/licenses/mit-license.php MIT License
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
4.4.17
4.6.1
7 changes: 4 additions & 3 deletions app/vendor/cakephp/cakephp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
}
],
"require": {
"php": ">=7.4.0",
"php": ">=7.4.0,<9",
"ext-intl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"cakephp/chronos": "^2.2",
"cakephp/chronos": "^2.4.0-RC2",
"composer/ca-bundle": "^1.2",
"laminas/laminas-diactoros": "^2.2.2",
"laminas/laminas-httphandlerrunner": "^1.1 || ^2.0",
Expand Down Expand Up @@ -58,7 +58,7 @@
"require-dev": {
"cakephp/cakephp-codesniffer": "^4.5",
"mikey179/vfsstream": "^1.6.10",
"paragonie/csp-builder": "^2.3",
"paragonie/csp-builder": "^2.3 || ^3.0",
"phpunit/phpunit": "^8.5 || ^9.3"
},
"suggest": {
Expand Down Expand Up @@ -88,6 +88,7 @@
},
"files": [
"src/Core/functions.php",
"src/Error/functions.php",
"src/Collection/functions.php",
"src/I18n/functions.php",
"src/Routing/functions.php",
Expand Down
Loading

0 comments on commit 11f0a76

Please sign in to comment.