Skip to content

Commit

Permalink
Merge pull request #38 from learnweb/update/m42
Browse files Browse the repository at this point in the history
Update for Moodle 4.2
  • Loading branch information
Laur0r authored May 12, 2023
2 parents 28aecf8 + ec65067 commit 55474e6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:

strategy:
matrix:
php: ['8.0']
moodle-branch: ['master'] # To be replaced with MOODLE_401_STABLE.
php: ['8.1']
moodle-branch: ['MOODLE_402_STABLE']
database: ['pgsql']

steps:
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Check for test folder
id: check_tests
run: |
echo "::set-output name=has_tests::${{ hashFiles('plugin/tests') != '' }}"
echo "has_tests=${{ hashFiles('plugin/tests') != '' }}" >> $GITHUB_OUTPUT
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -115,8 +115,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0']
moodle-branch: ['MOODLE_311_STABLE', 'MOODLE_400_STABLE', 'master'] # To be replaced with MOODLE_401_STABLE.
php: ['8.0', '8.1']
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE']
database: ['mariadb', 'pgsql']
include:
- php: '7.4'
Expand All @@ -125,6 +125,18 @@ jobs:
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_311_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_311_STABLE'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_400_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_400_STABLE'
database: 'pgsql'

steps:
- name: Start MariaDB
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/moodle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
--data-urlencode "altdownloadurl=${ZIPURL}" \
--data-urlencode "releasenotes=${BODY}" \
--data-urlencode "releasenotesformat=4")
echo "::set-output name=response::${RESPONSE}"
echo "response=${RESPONSE}" >> $GITHUB_OUTPUT
- name: Evaluate the response
id: evaluate-response
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public static function getDataMaskBit($maskPattern, $x, $y)
break;

case 4:
$intermediate = (BitUtils::unsignedRightShift($y, 1) + ($x / 3)) & 0x1;
$intermediate = intval((BitUtils::unsignedRightShift($y, 1) + ($x / 3))) & 0x1;
break;

case 5:
Expand Down
7 changes: 4 additions & 3 deletions thirdparty/vendor/endroid/qrcode/src/Writer/PngWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ protected function addLogo($sourceImage, $logoPath, $logoWidth = null)
$logoTargetHeight = intval($scale * imagesy($logoImage));
}

$logoX = imagesx($sourceImage) / 2 - $logoTargetWidth / 2;
$logoY = imagesy($sourceImage) / 2 - $logoTargetHeight / 2;
imagecopyresampled($sourceImage, $logoImage, $logoX, $logoY, 0, 0, $logoTargetWidth, $logoTargetHeight, $logoSourceWidth, $logoSourceHeight);
$logoX = intval(imagesx($sourceImage) / 2 - $logoTargetWidth / 2);
$logoY = intval(imagesy($sourceImage) / 2 - $logoTargetHeight / 2);
imagecopyresampled($sourceImage, $logoImage, $logoX, $logoY, 0, 0,
intval($logoTargetWidth), intval($logoTargetHeight), intval($logoSourceWidth), intval($logoSourceHeight));

return $sourceImage;
}
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

$plugin->component = 'block_qrcode'; // Full name of the plugin.
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 'v4.0-r1';
$plugin->version = 2022040400; // The current plugin version (Date: YYYMMDDXX).
$plugin->release = 'v4.2-r1';
$plugin->version = 2023051200; // The current plugin version (Date: YYYMMDDXX).
$plugin->requires = 2020061500; // Requires Moodle 3.9+.

0 comments on commit 55474e6

Please sign in to comment.