From 8dcfbef98cca79a8564bb32223275fbbdd63b397 Mon Sep 17 00:00:00 2001 From: alikon Date: Thu, 21 Aug 2025 09:11:17 +0200 Subject: [PATCH 01/16] backport-to-5.4 --- .devcontainer/Dockerfile | 56 +++++++++++ .devcontainer/devcontainer.json | 44 +++++++++ .devcontainer/docker-compose.yml | 28 ++++++ .devcontainer/post-create.sh | 159 +++++++++++++++++++++++++++++++ .devcontainer/xdebug.ini | 6 ++ 5 files changed, 293 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml create mode 100644 .devcontainer/post-create.sh create mode 100644 .devcontainer/xdebug.ini diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000000..65e0d3c1d2bae --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,56 @@ +# Start from the official PHP 8.2 image with Apache +FROM php:8.2-apache-bookworm + +# Install system dependencies, Node.js, Composer, and Cypress dependencies +RUN apt-get update && apt-get install -y \ + # System tools and git + git \ + unzip \ + curl \ + sudo \ + # PHP extensions dependencies + libpng-dev \ + libonig-dev \ + libxml2-dev \ + libzip-dev \ + # MySQL client AND server + default-mysql-client \ + default-mysql-server \ + # Cypress dependencies + xvfb \ + libgtk2.0-0 \ + libgtk-3-0 \ + libgbm-dev \ + libnotify-dev \ + libnss3 \ + libxss1 \ + libasound2 \ + libxtst6 \ + xauth \ + libldap2-dev \ + libgd-dev \ + && \ + # Install the required PHP extensions for Zip and MySQL + docker-php-ext-install zip mysqli gd ldap && \ + # Install Node.js (LTS version) + curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ + apt-get install -y nodejs && \ + # Install Composer globally + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \ + # Install Xdebug + pecl install xdebug && \ + # Clean up apt cache to reduce image size + apt-get clean && rm -rf /var/lib/apt/lists/* + +# After installing everything +RUN sed -i 's|/var/www/html|/workspaces/joomla-cms|g' /etc/apache2/sites-available/000-default.conf \ + && sed -i 's|/var/www/html|/workspaces/joomla-cms|g' /etc/apache2/apache2.conf + +# Enable Apache's rewrite module and set the ServerName to prevent warnings +RUN a2enmod rewrite \ + && echo "ServerName localhost" >> /etc/apache2/apache2.conf + +# Create a custom PHP configuration file to enable file uploads +RUN echo "upload_tmp_dir = /tmp" > /usr/local/etc/php/conf.d/custom-php.ini && \ + echo "post_max_size = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \ + echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000..933ff0e9927c2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,44 @@ +{ + "name": "Joomla Dev Environment", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspaces/joomla-cms", + "features": { + "ghcr.io/devcontainers/features/desktop-lite:1": {} + }, + "portsAttributes": { + "80" : { + "label": "Web Server (Joomla & phpmyadmin)", + "onAutoForward": "silent" + }, + "6080": { + "label": "Cypress GUI", + "onAutoForward": "silent" + } + }, + "postCreateCommand": "bash ./.devcontainer/post-create.sh", + "customizations": { + "vscode": { + "extensions": [ + "xdebug.php-debug", + "bmewburn.vscode-intelephense-client", + "esbenp.prettier-vscode" + ], + "settings": { + "launch": { + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003, + "log": false + } + ] + } + } + } + }, + "remoteUser": "root" +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000000000..593e2e3043a65 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,28 @@ +services: + app: + build: + context: . + dockerfile: Dockerfile + volumes: + - ..:/workspaces/joomla-cms:cached + - ./xdebug.ini:/usr/local/etc/php/conf.d/99-xdebug.ini + ports: + - "80:80" + - "3306:3306" + - "6080:6080" + command: sleep infinity + + mysql: + image: mysql:8.0 + command: --default-authentication-plugin=mysql_native_password + restart: unless-stopped + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: test_joomla + MYSQL_USER: joomla_ut + MYSQL_PASSWORD: joomla_ut + volumes: + - "mysql-data:/var/lib/mysql" + +volumes: + mysql-data: \ No newline at end of file diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100644 index 0000000000000..0d3024393cd40 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,159 @@ +#!/bin/bash + +# Exit immediately if a command exits with a non-zero status. +set -e + +echo "--- Starting Joomla Core Post-Creation Setup ---" + +# Configuration variables +DB_NAME="test_joomla" +DB_USER="joomla_ut" +DB_PASS="joomla_ut" +ADMIN_USER="ci-admin" +ADMIN_REAL_NAME="jane doe" +ADMIN_PASS="joomla-17082005" +ADMIN_EMAIL="admin@example.com" +JOOMLA_ROOT="/workspaces/joomla-cms" + +# Allow git commands to run safely in the container +git config --global --add safe.directory $JOOMLA_ROOT + +# --- 1. Wait for MariaDB Service --- +echo "--> Waiting for MariaDB to become available..." +while ! mysqladmin ping -h"mysql" --silent; do + sleep 1 +done +echo "✅ MariaDB is ready." + +# --- 2. Install Core Dependencies --- +echo "--> Installing Composer and NPM dependencies..." +composer install +npm install +echo "✅ Dependencies installed." + +# --- 3. Install Joomla from Repository Source --- +echo "--> Installing Joomla using the local repository source..." +php installation/joomla.php install \ + --site-name="Joomla CMS Test" \ + --admin-user="$ADMIN_REAL_NAME" \ + --admin-username="$ADMIN_USER" \ + --admin-password="$ADMIN_PASS" \ + --admin-email="$ADMIN_EMAIL" \ + --db-type="mysqli" \ + --db-host="mysql" \ + --db-name="$DB_NAME" \ + --db-user="$DB_USER" \ + --db-pass="$DB_PASS" \ + --db-prefix="jos_" \ + --db-encryption="0" \ + --public-folder="" +echo "✅ Joomla installed." + +# --- 4. Configure Joomla for Development --- +echo "--> Applying development settings..." +# Enable debug mode and maximum error reporting for easier troubleshooting. +php cli/joomla.php config:set error_reporting=maximum +echo "✅ Development settings applied." + +# --- 5. Install and Configure phpMyAdmin --- +PMA_ROOT="${JOOMLA_ROOT}/phpmyadmin" +echo "--> Downloading phpMyAdmin into $PMA_ROOT..." +PMA_VERSION=5.2.2 +mkdir -p $PMA_ROOT +curl -o /tmp/phpmyadmin.tar.gz https://files.phpmyadmin.net/phpMyAdmin/${PMA_VERSION}/phpMyAdmin-${PMA_VERSION}-all-languages.tar.gz +tar xf /tmp/phpmyadmin.tar.gz --strip-components=1 -C $PMA_ROOT +rm /tmp/phpmyadmin.tar.gz +cp $PMA_ROOT/config.sample.inc.php $PMA_ROOT/config.inc.php +sed -i "/\['AllowNoPassword'\] = false/a \$cfg['Servers'][\$i]['host'] = 'mysql';" $PMA_ROOT/config.inc.php + +# --- 6. Apply Codespaces Host Fix --- +# This ensures Joomla generates correct URLs when accessed through the forwarded port. +echo "--> Applying Codespaces URL fix..." +cat > "${JOOMLA_ROOT}/fix.php" << 'EOF' + Ignoring local changes..." +# For TRACKED files, tell Git to stop watching them for changes +git update-index --assume-unchanged "index.php" +git update-index --assume-unchanged "administrator/index.php" +git update-index --assume-unchanged "package-lock.json" +git update-index --assume-unchanged "tests/System/integration/install/Installation.cy.js" +git update-index --assume-unchanged "tests/System/support/commands/config.mjs" + +# For NEW UNTRACKED files, add them to the local exclude file +echo "cypress.config.js" >> ".git/info/exclude" +echo "fix.php" >> ".git/info/exclude" +echo "administrator/fix.php" >> ".git/info/exclude" +echo "phpmyadmin" >> ".git/info/exclude" +echo "codespace-details.txt" >> ".git/info/exclude" + +# --- 7. Finalize Permissions and Testing Tools --- +echo "--> Setting up file permissions and Cypress..." +sed -i \ + -e "/\/\/ If exists, delete PHP configuration file to force a new installation/d" \ + -e "/cy.task('deleteRelativePath', 'configuration.php');/d" \ + -e "/cy.installJoomla(config);/d" \ + tests/System/integration/install/Installation.cy.js +sed -i "s/return cy.task('writeRelativeFile', { path: 'configuration.php', content });/return cy.task('writeRelativeFile', { path: 'configuration.php', content, mode: 0o775 });/" tests/System/support/commands/config.mjs + +# Ensure Cypress is executable and owned by the web server user +chmod +x ./node_modules/.bin/cypress +cp cypress.config.dist.mjs cypress.config.js +npx cypress install +sed -i -e "s|baseUrl:.*|baseUrl: 'http://localhost:80',|" -e "s/db_host: 'localhost'/db_host: 'mysql'/g" -e "s/db_user: 'root'/db_user: 'joomla_ut'/g" -e "s/db_password: ''/db_password: 'joomla_ut'/g" cypress.config.js + +# Restart Apache to apply all changes +echo ' + AllowOverride All + Require all granted +' | sudo tee -a /etc/apache2/apache2.conf +service apache2 restart + +# Set the group to www-data and enforce group permissions +echo "--> Applying final group ownership and permissions..." +chgrp -R www-data $JOOMLA_ROOT +chmod -R g+rws $JOOMLA_ROOT + +echo "✅ Environment finalized." + +# --- 8. Display Setup Details --- +# Save the details to a file for easy reference. +DETAILS_FILE="${JOOMLA_ROOT}/codespace-details.txt" +{ + echo "" + echo "---" + echo "🚀 Joomla Core development environment is ready! 🚀" + echo "" + echo "This information has been saved to codespace-details.txt" + echo "" + echo "Joomla Admin Login:" + echo " URL: Open the 'Ports' tab, find the 'Web Server' (80), and click the Globe icon. Then add /administrator" + echo " Username: $ADMIN_USER" + echo " Password: $ADMIN_PASS" + echo "" + echo "phpMyAdmin Login:" + echo " URL: Open the 'Web Server' port and add /phpmyadmin" + echo " Username: $DB_USER" + echo " Password: $DB_PASS" + echo "" + echo "Cypress E2E Testing:" + echo " Run interactive tests: npx cypress open" + echo " Run headless tests: npx cypress run" + echo "" + echo "Xdebug for PHP Debugging:" + echo " Xdebug is pre-configured on port 9003. Use the 'Run and Debug' panel in VS Code and select 'Listen for Xdebug'." + echo "---" +} | tee "$DETAILS_FILE" \ No newline at end of file diff --git a/.devcontainer/xdebug.ini b/.devcontainer/xdebug.ini new file mode 100644 index 0000000000000..629aef993a2b1 --- /dev/null +++ b/.devcontainer/xdebug.ini @@ -0,0 +1,6 @@ +[xdebug] +zend_extension=xdebug +xdebug.mode=debug +xdebug.start_with_request=yes +xdebug.client_port=9003 +xdebug.client_host=localhost \ No newline at end of file From 07d8c1ff6cd03e7f3b6403c86b664c726038e2a9 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Fri, 22 Aug 2025 11:55:13 +0200 Subject: [PATCH 02/16] add php_errors.log --- .devcontainer/Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 65e0d3c1d2bae..d05bce6488b7e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -53,4 +53,11 @@ RUN a2enmod rewrite \ # Create a custom PHP configuration file to enable file uploads RUN echo "upload_tmp_dir = /tmp" > /usr/local/etc/php/conf.d/custom-php.ini && \ echo "post_max_size = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \ - echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini \ No newline at end of file + echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \ + mkdir -p /var/log/ && \ + touch /var/log/php_errors.log && \ + chown -R www-data:www-data /var/log/ && \ + chmod 766 /var/log/php_errors.log && \ + echo "log_errors = On" >> /usr/local/etc/php/conf.d/custom-php.ini && \ + echo "error_log = /var/log/php_errors.log" >> /usr/local/etc/php/conf.d/custom-php.ini && \ + echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/custom-php.ini From d058ff3a64860da7bf8dc217003ee15c062003e8 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Fri, 22 Aug 2025 12:18:06 +0200 Subject: [PATCH 03/16] log_level --- .devcontainer/xdebug.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/xdebug.ini b/.devcontainer/xdebug.ini index 629aef993a2b1..61b89fca18d38 100644 --- a/.devcontainer/xdebug.ini +++ b/.devcontainer/xdebug.ini @@ -1,6 +1,7 @@ [xdebug] zend_extension=xdebug xdebug.mode=debug +xdebug.log_level = 0 xdebug.start_with_request=yes xdebug.client_port=9003 -xdebug.client_host=localhost \ No newline at end of file +xdebug.client_host=localhost From beffd6e2c6c2afe986e3cffd06030b543a6e5f31 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Fri, 22 Aug 2025 12:18:53 +0200 Subject: [PATCH 04/16] recreate configuration on restart --- .devcontainer/post-create.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 0d3024393cd40..06220f89b5a60 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -33,6 +33,7 @@ echo "✅ Dependencies installed." # --- 3. Install Joomla from Repository Source --- echo "--> Installing Joomla using the local repository source..." +rm -f configuration.php php installation/joomla.php install \ --site-name="Joomla CMS Test" \ --admin-user="$ADMIN_REAL_NAME" \ @@ -156,4 +157,4 @@ DETAILS_FILE="${JOOMLA_ROOT}/codespace-details.txt" echo "Xdebug for PHP Debugging:" echo " Xdebug is pre-configured on port 9003. Use the 'Run and Debug' panel in VS Code and select 'Listen for Xdebug'." echo "---" -} | tee "$DETAILS_FILE" \ No newline at end of file +} | tee "$DETAILS_FILE" From 396c970997404b83e45315d991fd643d72516287 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Mon, 25 Aug 2025 10:04:38 +0200 Subject: [PATCH 05/16] ssl --- .devcontainer/Dockerfile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d05bce6488b7e..3e71214f8c8db 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -50,14 +50,21 @@ RUN sed -i 's|/var/www/html|/workspaces/joomla-cms|g' /etc/apache2/sites-availab RUN a2enmod rewrite \ && echo "ServerName localhost" >> /etc/apache2/apache2.conf -# Create a custom PHP configuration file to enable file uploads -RUN echo "upload_tmp_dir = /tmp" > /usr/local/etc/php/conf.d/custom-php.ini && \ - echo "post_max_size = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \ - echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \ - mkdir -p /var/log/ && \ +RUN apt-get update && apt-get install -y ssl-cert && \ + a2enmod ssl && \ + a2ensite 000-default && \ + a2ensite default-ssl && \ + sed -i 's|/var/www/html|/workspaces/joomla-cms|g' /etc/apache2/sites-available/default-ssl.conf && \ + echo '\n Options Indexes FollowSymLinks\n AllowOverride All\n Require all granted\n' >> /etc/apache2/sites-available/default-ssl.conf + +# Create a custom PHP configuration file to enable file uploads and a log directory +RUN mkdir -p /var/log/ && \ touch /var/log/php_errors.log && \ chown -R www-data:www-data /var/log/ && \ - chmod 766 /var/log/php_errors.log && \ + chmod 766 /var/log/php_errors.log && \ + echo "upload_tmp_dir = /tmp" > /usr/local/etc/php/conf.d/custom-php.ini && \ + echo "post_max_size = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \ + echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \ echo "log_errors = On" >> /usr/local/etc/php/conf.d/custom-php.ini && \ echo "error_log = /var/log/php_errors.log" >> /usr/local/etc/php/conf.d/custom-php.ini && \ echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/custom-php.ini From 302d3770e9cc770ecd321f38b34b75873a717e9a Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Mon, 25 Aug 2025 10:08:17 +0200 Subject: [PATCH 06/16] 443 --- .devcontainer/devcontainer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 933ff0e9927c2..9a93f372e6177 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ "ghcr.io/devcontainers/features/desktop-lite:1": {} }, "portsAttributes": { - "80" : { + "443" : { "label": "Web Server (Joomla & phpmyadmin)", "onAutoForward": "silent" }, @@ -41,4 +41,4 @@ } }, "remoteUser": "root" -} \ No newline at end of file +} From 0168273e0929793cf45caba9650b23e82cee0b4b Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Mon, 25 Aug 2025 10:11:54 +0200 Subject: [PATCH 07/16] 443 --- .devcontainer/docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 593e2e3043a65..0d47fdd66174a 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -8,6 +8,7 @@ services: - ./xdebug.ini:/usr/local/etc/php/conf.d/99-xdebug.ini ports: - "80:80" + - "443:443" - "3306:3306" - "6080:6080" command: sleep infinity @@ -25,4 +26,4 @@ services: - "mysql-data:/var/lib/mysql" volumes: - mysql-data: \ No newline at end of file + mysql-data: From 13ebbb87c4c7c9bee177de5676c7afaddea5c064 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Mon, 25 Aug 2025 10:18:53 +0200 Subject: [PATCH 08/16] https --- .devcontainer/post-create.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 06220f89b5a60..b8fdfc045205c 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -73,7 +73,7 @@ echo "--> Applying Codespaces URL fix..." cat > "${JOOMLA_ROOT}/fix.php" << 'EOF' > ".git/info/exclude" echo "fix.php" >> ".git/info/exclude" -echo "administrator/fix.php" >> ".git/info/exclude" echo "phpmyadmin" >> ".git/info/exclude" echo "codespace-details.txt" >> ".git/info/exclude" @@ -108,13 +106,12 @@ sed -i \ -e "/cy.task('deleteRelativePath', 'configuration.php');/d" \ -e "/cy.installJoomla(config);/d" \ tests/System/integration/install/Installation.cy.js -sed -i "s/return cy.task('writeRelativeFile', { path: 'configuration.php', content });/return cy.task('writeRelativeFile', { path: 'configuration.php', content, mode: 0o775 });/" tests/System/support/commands/config.mjs # Ensure Cypress is executable and owned by the web server user chmod +x ./node_modules/.bin/cypress cp cypress.config.dist.mjs cypress.config.js npx cypress install -sed -i -e "s|baseUrl:.*|baseUrl: 'http://localhost:80',|" -e "s/db_host: 'localhost'/db_host: 'mysql'/g" -e "s/db_user: 'root'/db_user: 'joomla_ut'/g" -e "s/db_password: ''/db_password: 'joomla_ut'/g" cypress.config.js +sed -i -e "s|baseUrl:.*|baseUrl: 'https://localhost',|" -e "s/db_host: 'localhost'/db_host: 'mysql'/g" -e "s/db_user: 'root'/db_user: 'joomla_ut'/g" -e "s/db_password: ''/db_password: 'joomla_ut'/g" cypress.config.js # Restart Apache to apply all changes echo ' @@ -141,7 +138,7 @@ DETAILS_FILE="${JOOMLA_ROOT}/codespace-details.txt" echo "This information has been saved to codespace-details.txt" echo "" echo "Joomla Admin Login:" - echo " URL: Open the 'Ports' tab, find the 'Web Server' (80), and click the Globe icon. Then add /administrator" + echo " URL: Open the 'Ports' tab, find the 'Web Server' (443), and click the Globe icon. Then add /administrator" echo " Username: $ADMIN_USER" echo " Password: $ADMIN_PASS" echo "" From 54a420b28adebde0546cd62d761acc0ecce527ad Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 26 Aug 2025 09:14:21 +0000 Subject: [PATCH 09/16] =?UTF-8?q?=20=E2=9C=94=20=20All=20specs=20passed!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/post-create.sh | 1 + .../site/components/com_contact/Router.cy.js | 26 ++++++++++++------- .../site/components/com_content/Router.cy.js | 26 ++++++++++++------- 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index b8fdfc045205c..804916075b835 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -106,6 +106,7 @@ sed -i \ -e "/cy.task('deleteRelativePath', 'configuration.php');/d" \ -e "/cy.installJoomla(config);/d" \ tests/System/integration/install/Installation.cy.js +sed -i "s/return cy.task('writeRelativeFile', { path: 'configuration.php', content });/return cy.task('writeRelativeFile', { path: 'configuration.php', content, mode: 0o775 });/" tests/System/support/commands/config.mjs # Ensure Cypress is executable and owned by the web server user chmod +x ./node_modules/.bin/cypress diff --git a/tests/System/integration/site/components/com_contact/Router.cy.js b/tests/System/integration/site/components/com_contact/Router.cy.js index d52431d4042cc..2441950055472 100644 --- a/tests/System/integration/site/components/com_contact/Router.cy.js +++ b/tests/System/integration/site/components/com_contact/Router.cy.js @@ -44,16 +44,22 @@ describe('Test in frontend that the contact site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}-${contact.alias}`, followRedirect: false }).then((response) => { - expect(response.status).to.eq(301); - expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + expect(response.status).to.eq(200); + // expect(response.status).to.eq(301); + // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}&catid=${contact.catid}`, followRedirect: false }).then((response) => { - expect(response.status).to.eq(301); - expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + expect(response.status).to.eq(200); + // expect(response.status).to.eq(301); + // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}-${contact.alias}&catid=${contact.catid}`, followRedirect: false }).then((response) => { - expect(response.status).to.eq(301); - expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + expect(response.status).to.eq(200); + // expect(response.status).to.eq(301); + // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.visit(url); @@ -81,8 +87,10 @@ describe('Test in frontend that the contact site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}-${contact.alias}&catid=${contact.catid}`, followRedirect: false }).then((response) => { - expect(response.status).to.eq(301); - expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + expect(response.status).to.eq(200); + // expect(response.status).to.eq(301); + // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.visit(url.split('/').slice(0, -1).join('/')); @@ -181,4 +189,4 @@ describe('Test in frontend that the contact site router', () => { }); }); }); -}); +}); \ No newline at end of file diff --git a/tests/System/integration/site/components/com_content/Router.cy.js b/tests/System/integration/site/components/com_content/Router.cy.js index 6b2a5eb0a7ee8..cf6e7a2e7b466 100644 --- a/tests/System/integration/site/components/com_content/Router.cy.js +++ b/tests/System/integration/site/components/com_content/Router.cy.js @@ -43,16 +43,22 @@ describe('Test in frontend that the content site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}-${article.alias}`, followRedirect: false }).then((response) => { - expect(response.status).to.eq(301); - expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + expect(response.status).to.eq(200); + // expect(response.status).to.eq(301); + // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}&catid=${article.catid}`, followRedirect: false }).then((response) => { - expect(response.status).to.eq(301); - expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + expect(response.status).to.eq(200); + // expect(response.status).to.eq(301); + // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}-${article.alias}&catid=${article.catid}`, followRedirect: false }).then((response) => { - expect(response.status).to.eq(301); - expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + expect(response.status).to.eq(200); + // expect(response.status).to.eq(301); + // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.visit(url); @@ -79,8 +85,10 @@ describe('Test in frontend that the content site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}-${article.alias}&catid=${article.catid}`, followRedirect: false }).then((response) => { - expect(response.status).to.eq(301); - expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + expect(response.status).to.eq(200); + // expect(response.status).to.eq(301); + // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.visit(url.split('/').slice(0, -1).join('/')); @@ -177,4 +185,4 @@ describe('Test in frontend that the content site router', () => { }); }); }); -}); +}); \ No newline at end of file From 8fd62dd99c95857896c7f6c2fd73167e105b7dce Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 26 Aug 2025 11:50:02 +0200 Subject: [PATCH 10/16] restart --- .../integration/site/components/com_contact/Router.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/System/integration/site/components/com_contact/Router.cy.js b/tests/System/integration/site/components/com_contact/Router.cy.js index 2441950055472..714fba2782918 100644 --- a/tests/System/integration/site/components/com_contact/Router.cy.js +++ b/tests/System/integration/site/components/com_contact/Router.cy.js @@ -44,7 +44,7 @@ describe('Test in frontend that the contact site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}-${contact.alias}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. + // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done expect(response.status).to.eq(200); // expect(response.status).to.eq(301); // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); @@ -189,4 +189,4 @@ describe('Test in frontend that the contact site router', () => { }); }); }); -}); \ No newline at end of file +}); From e4d30c9f61de3ad3fdcc5c541d3365975d402957 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 26 Aug 2025 12:12:43 +0200 Subject: [PATCH 11/16] 301 --- .../integration/site/components/com_content/Router.cy.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/System/integration/site/components/com_content/Router.cy.js b/tests/System/integration/site/components/com_content/Router.cy.js index cf6e7a2e7b466..e77749f84edc2 100644 --- a/tests/System/integration/site/components/com_content/Router.cy.js +++ b/tests/System/integration/site/components/com_content/Router.cy.js @@ -43,10 +43,8 @@ describe('Test in frontend that the content site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}-${article.alias}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. - expect(response.status).to.eq(200); - // expect(response.status).to.eq(301); - // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + expect(response.status).to.eq(301); + expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}&catid=${article.catid}`, followRedirect: false }).then((response) => { // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. @@ -185,4 +183,4 @@ describe('Test in frontend that the content site router', () => { }); }); }); -}); \ No newline at end of file +}); From fc33e27ff398e1e56f93a9aa376d4cb091edef64 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 26 Aug 2025 12:28:29 +0200 Subject: [PATCH 12/16] site/components/com_content/Router.cy.js --- .../site/components/com_content/Router.cy.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/System/integration/site/components/com_content/Router.cy.js b/tests/System/integration/site/components/com_content/Router.cy.js index e77749f84edc2..639035f137c18 100644 --- a/tests/System/integration/site/components/com_content/Router.cy.js +++ b/tests/System/integration/site/components/com_content/Router.cy.js @@ -47,10 +47,8 @@ describe('Test in frontend that the content site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}&catid=${article.catid}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. - expect(response.status).to.eq(200); - // expect(response.status).to.eq(301); - // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + expect(response.status).to.eq(301); + expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}-${article.alias}&catid=${article.catid}`, followRedirect: false }).then((response) => { // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. @@ -83,10 +81,8 @@ describe('Test in frontend that the content site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}-${article.alias}&catid=${article.catid}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. - expect(response.status).to.eq(200); - // expect(response.status).to.eq(301); - // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + expect(response.status).to.eq(301); + expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.visit(url.split('/').slice(0, -1).join('/')); From 7801f800cec234d66298eff375774f79135bb48d Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 26 Aug 2025 12:46:36 +0200 Subject: [PATCH 13/16] Router fox contact --- .../site/components/com_contact/Router.cy.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/System/integration/site/components/com_contact/Router.cy.js b/tests/System/integration/site/components/com_contact/Router.cy.js index 714fba2782918..335d3c76c34db 100644 --- a/tests/System/integration/site/components/com_contact/Router.cy.js +++ b/tests/System/integration/site/components/com_contact/Router.cy.js @@ -44,10 +44,8 @@ describe('Test in frontend that the contact site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}-${contact.alias}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done - expect(response.status).to.eq(200); - // expect(response.status).to.eq(301); - // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + expect(response.status).to.eq(301); + expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}&catid=${contact.catid}`, followRedirect: false }).then((response) => { // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. @@ -87,10 +85,8 @@ describe('Test in frontend that the contact site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}-${contact.alias}&catid=${contact.catid}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. - expect(response.status).to.eq(200); - // expect(response.status).to.eq(301); - // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + expect(response.status).to.eq(301); + expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.visit(url.split('/').slice(0, -1).join('/')); From 5df7c44ebaad384d66edb5f9e40abf6794ac3563 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 26 Aug 2025 12:47:50 +0200 Subject: [PATCH 14/16] Router for content --- .../integration/site/components/com_content/Router.cy.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/System/integration/site/components/com_content/Router.cy.js b/tests/System/integration/site/components/com_content/Router.cy.js index 639035f137c18..6b2a5eb0a7ee8 100644 --- a/tests/System/integration/site/components/com_content/Router.cy.js +++ b/tests/System/integration/site/components/com_content/Router.cy.js @@ -51,10 +51,8 @@ describe('Test in frontend that the content site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_content&view=article&id=${article.id}-${article.alias}&catid=${article.catid}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. - expect(response.status).to.eq(200); - // expect(response.status).to.eq(301); - // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + expect(response.status).to.eq(301); + expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.visit(url); From a9d1c2ea6953204645c90cb50d2f4c256ba548ed Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 26 Aug 2025 13:50:02 +0200 Subject: [PATCH 15/16] contact Router.cy.js --- .../integration/site/components/com_contact/Router.cy.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/System/integration/site/components/com_contact/Router.cy.js b/tests/System/integration/site/components/com_contact/Router.cy.js index 335d3c76c34db..111f668b6c42e 100644 --- a/tests/System/integration/site/components/com_contact/Router.cy.js +++ b/tests/System/integration/site/components/com_contact/Router.cy.js @@ -48,10 +48,8 @@ describe('Test in frontend that the contact site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}&catid=${contact.catid}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. - expect(response.status).to.eq(200); - // expect(response.status).to.eq(301); - // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + expect(response.status).to.eq(301); + expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}-${contact.alias}&catid=${contact.catid}`, followRedirect: false }).then((response) => { // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. From 23ee720a82a3e6a30e5fa7f04b13f186ae1f3ee8 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 26 Aug 2025 14:06:33 +0200 Subject: [PATCH 16/16] contact Router.cy.js --- .../integration/site/components/com_contact/Router.cy.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/System/integration/site/components/com_contact/Router.cy.js b/tests/System/integration/site/components/com_contact/Router.cy.js index 111f668b6c42e..d52431d4042cc 100644 --- a/tests/System/integration/site/components/com_contact/Router.cy.js +++ b/tests/System/integration/site/components/com_contact/Router.cy.js @@ -52,10 +52,8 @@ describe('Test in frontend that the contact site router', () => { expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.request({ url: `/index.php?option=com_contact&view=contact&id=${contact.id}-${contact.alias}&catid=${contact.catid}`, followRedirect: false }).then((response) => { - // @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done. - expect(response.status).to.eq(200); - // expect(response.status).to.eq(301); - // expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); + expect(response.status).to.eq(301); + expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`)); }); cy.visit(url);