Skip to content

Commit

Permalink
Update 4.1 from 4.0 (joomla#36690)
Browse files Browse the repository at this point in the history
* [4.0] Backup message (joomla#36487)

Many users who use their hosts backup facility and this is typically __only__ for files

This update reminds them to backup the database as well

* Remove reference & in usort callback function (joomla#36503)

* Update paragonie sodium_compat to 1.17.0 (joomla#36491)

Co-authored-by: Benjamin Trenkle <[email protected]>

* [3.10] Finder plugins modify component params registry / Backport joomla#35855 (joomla#36141)

* Backport joomla#35855 to 3.10

* one space to much

* [4.0]  xml code style (joomla#36532)

Fixes a few spaces to tabs issues

* [4.0] media manager breadcrumbs (joomla#36154)

* [4.0] media manager breadcrumbs

The RTL specific css was wrong as can be seen in the before screenshot

This PR removes the RTL specific css (should have been scss) and updates the scss to use logical properties instead.

This PR also removes an unused class `breadcrumb-item`.

To test RTL you will need to install arabic or persian.

and dont forget to npm ci

There is no visible change in LTR and the RTL changes are as shown below

## Before LTR

## Before RTL

## After LTR

## After RTL

* revert

* [4.0] RTL: Correcting Admin login 2factor and feedback hints (joomla#36024)

This is a replacement to the merged PR joomla#32104

It does exactly the same thing but by using css logical properties we avoid the need to maintain both an LTR and an RTL version[4.0]

There is no visual change

* [4.0] Category list (joomla#36536)

Remove extra div that is not needed

* [4.0] Make routing work in console applications (joomla#36332)

* Update list-fancy-select.php (joomla#36543)

replace tab with space

code review

* [4.0] archive icon (joomla#36263)

All the state icons are grey so that the published icon, which is green, stands out visually.

The archived icon however was black. This PR changes that icon to grey.

### Before

### After

* [4.0] Banner Client tips (joomla#36262)

* [4.0] Banner Client tips

Adds a tooltip to the banner client numbers so that they appear the same as category numbers. Also corrects the class on the trashed number so that it has the correct colour

To test
Create one banner client
Create a banner for the client in each of the published states

* Update administrator/components/com_banners/tmpl/clients/default.php

oops

Co-authored-by: Quy <[email protected]>

Co-authored-by: Quy <[email protected]>

* Fix article creation from frontend (joomla#36542)

* [4.0] Handle when toggle icon is not available (joomla#36329)

* Handle when toggle icon is not available

* cs

* Take workflow extension into account when setting a default (joomla#36527)

* Fix uploadlimits checks (joomla#36023)

* Make edit_lock layout reusable for other extensions (joomla#35112)

* Allow to set a value for SubformField (joomla#35921)

* [4.0] Fix example in cleanImageURL docblock (joomla#36554)

* Fix Codemirror behind tabs (joomla#36140)

* Fix Codemirror behind tabs

* jscs

* Remove dependency on Factory in AdminController

* [4.0] Ensure path contains api in the router (joomla#36315)

* [4.0] Check model is set before calling its methods (joomla#36378)

* Check model is set before calling its methods

* Update OverridesController.php

* Category edit form should use return url (joomla#36560)

Currently the article edit form respects return URLs; the category edit form does not. Adding it here makes for a more consistent editing experience.

* [4.0] Sample Data plugin images (joomla#36237)

Updates the plugin to use the new image data used in lazy loading etc. This avoids confusion for users who see different source code for their created articles when compared to the same data plugins

To test. Just make sure the sample data still installs and works as expected

* [4.0] If the Mail Template was not found in the db, return false (joomla#36489)

* [4.0] Code Style (joomla#36564)

* Use an absolute path in image list field (joomla#36063)

* Correct Cache setWorkarounds to take account of multiple script or style declarations being used that mean that we have an array of scripts or stylesheets to be cached and not just a string (joomla#36068)

Cache setWorkarounds returns an array not a string

* [3] privacy request by logged in user only (joomla#35470)

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* Update components/com_privacy/controller.php

Co-authored-by: Quy <[email protected]>

Co-authored-by: Quy <[email protected]>

* Feature - Add always count option to 404 redirects (joomla#34640)

* Feature - Add always count option to 404 redirects

* Add missiing space for code sniffer

* Return line for if statement

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>

* Alpha Ordering - Change Constant too.

* update constant

* Update en-GB.plg_system_redirect.ini

* remove trailing whtiespace

* Remove Added Language Strings

* Update plugins/system/redirect/redirect.php

Co-authored-by: Phil E. Taylor <[email protected]>

* Update redirect.xml

* Update redirect.php

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>

* Update plugins/system/redirect/redirect.php

Co-authored-by: Benjamin Trenkle <[email protected]>

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>
Co-authored-by: Benjamin Trenkle <[email protected]>

* php8 deprecation str_replace Passing null to param (joomla#36400)

* add php 8.1 to the version array (joomla#36577)

* Add function parameters for callbacks. Fixes joomla#36010

* PHP 8.1 deprecation fixes (joomla#36306)

* Backport some deprecation fixes from the J4 branch

* Ensure htmlspecialchars is passed a string

* Ignore PHPCS errors

Co-authored-by: Tobias Zulauf <[email protected]>

* Update simplepie to 1.3.3 (joomla#36358)

* Update simplepie to 1.3.2 & phar-stream-wrapper to 2.2.2

* update to simplepie 1.3.3 to fix the version

* [3.10] Dont show the pre upgrade checker when the upgrade is not supported (joomla#36312)

* [3.10] Fix Progressive caching to cache modules per custom menu assignment (joomla#36324)

* Fix progressive caching

* Update libraries/src/Document/HtmlDocument.php

Co-authored-by: Phil E. Taylor <[email protected]>

* cast int

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>

* Bump registry to 1.6.4 (joomla#36611)

* [4.0] Load the subform data correctly (joomla#36598)

* Load the subform data correctly

* correct order

* don't remove <joomla-hidden-mail> (joomla#36602)

* [4.0] Function to unregister a provider in media manager (joomla#36594)

* [4.0] Latests/Popular Admin modules permissions (joomla#36559)

* Allow our phpcode sniffer composer plugin to run

* PHP 8.1 fixes ported from joomla#36355

* Fix codestyle. Thanks @brianteeman

* Improve security and type checking of the installer task

* Ensure the rule modifier is a string by default

* Ensure cpanel dashboard name is type safe (PHP 8.1)

* Fix mistake in param ordering

* Fix PHP 8.1 notice when creating an article

* Fix URL Field giving deprecated notices in PHP 8.1

* [4.0] Fix template preview (joomla#36268)

* Fix template preview

* Fix template preview

* Fix Progressive caching to cache modules per custom menu assignment (joomla#36193)

* Cross Origin for Google Fonts (joomla#36592)

* Update Tobscure library to be PHP 8.1 compat

* Tag 4.0.6 RC1

* Reset to dev

* Translation Update (joomla#36356)

* [4.0] Fix images (joomla#35780)

* [4.0] Joomla Update Silent fails (joomla#36492)

* [4.0] Joomla Update Silent fails

I am not 100% certain that this is the best approach to this. @nikosdion @wilsonge please advise

## The Problem
As reported in # if during an update a sql query fails then the updater quits the sql part of the update process and moves on. The joomla_update log gives no indication that there has been a problem etc.

## Proposed Partial Solution
Adds a Start SQL and End SQL to the logs
If there is an error in the sql then that is written to the logs as well AND it now says End SQL incomplete

### Testing
For the testing we will be using the "Update your site by manually uploading the update package." and to make things quick I have prepared an empty update that you should download and use.

### Before Test 1
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 2
Update your database to change the value in the #__schemas table so that the version_id is 4.0.0-2018-5-15
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 3
Update your database to change the value in the #__schemas table so that the version_id is 4.0.3
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### After - Test 1
Update your database to change the value in the #__schemas table so that the version_id is 4.0.4

Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### After -  Test 2
Update your database to change the value in the #__schemas table so that the version_id is 4.0.0-2018-5-15
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 3
Update your database to change the value in the #__schemas table so that the version_id is 4.0.3
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

* Fix null being passed to DateTime::__construct causing PHP 8.1 deprecation error

* Missing param default to fix uploads in PHP 8.1

* Tag 4.0.6 RC2

* Reset to dev

* Missing param default to fix renaming media in PHP 8.1

* Stub generator now handles deprecated namespaced classes (joomla#35144)

* Fix error in article model (joomla#36617)

* Fix code comment

* Temporary remove phpnext tests (joomla#36624)

* Sign drone.yml

* Translation Update (joomla#36645)

* Update extract.php (joomla#36635)

* Update composer.lock

Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Harald Leithner <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>
Co-authored-by: Allon Moritz <[email protected]>
Co-authored-by: Quy <[email protected]>
Co-authored-by: Nicola Galgano <[email protected]>
Co-authored-by: Roland Dalmulder <[email protected]>
Co-authored-by: Tuan Pham Ngoc <[email protected]>
Co-authored-by: Fedir Zinchuk <[email protected]>
Co-authored-by: wilsonge <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Crystal Dionysopoulos <[email protected]>
Co-authored-by: heelc29 <[email protected]>
Co-authored-by: Geraint Edwards <[email protected]>
Co-authored-by: Tony Partridge <[email protected]>
Co-authored-by: frostmakk <[email protected]>
Co-authored-by: Dimitris Grammatikogiannis <[email protected]>
Co-authored-by: joomla-translation-bot <[email protected]>
Co-authored-by: Richard Fath <[email protected]>
Co-authored-by: Sveinung Larsen <[email protected]>
  • Loading branch information
21 people authored Jan 15, 2022
1 parent 747e9e7 commit 989c719
Show file tree
Hide file tree
Showing 94 changed files with 551 additions and 347 deletions.
117 changes: 64 additions & 53 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,39 +182,41 @@ steps:
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysql

- name: phpnext-api-mysql
depends_on:
- phpmin-api-mysql
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpnext
# - name: phpnext-api-mysql
# depends_on:
# - phpmin-api-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpnext

- name: phpmin-api-postgres
depends_on:
- phpnext-api-mysql
# - phpnext-api-mysql
- phpmin-api-mysql
image: joomlaprojects/docker-images:systemtests
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgres

- name: phpnext-api-postgres
depends_on:
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpnext
# - name: phpnext-api-postgres
# depends_on:
# - phpmin-api-postgres
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpnext

- name: phpmax-api-postgres
depends_on:
- phpnext-api-postgres
# - phpnext-api-postgres
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.1
failure: ignore
environment:
Expand All @@ -233,53 +235,62 @@ steps:
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql

- name: phpnext-system-mysql
depends_on: [ phpmin-system-mysql ]
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysqlphpnext
# - name: phpnext-system-mysql
# depends_on:
# - phpmin-system-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" mysqlphpnext

- name: phpmax-system-mysql
depends_on: [ phpnext-system-mysql ]
depends_on:
# - phpnext-system-mysql
- phpmin-system-mysql
image: joomlaprojects/docker-images:systemtests8.1
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysqlphpmax

- name: phpnext-system-mysql8
depends_on: [ phpmax-system-mysql ]
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8phpnext
# - name: phpnext-system-mysql8
# depends_on:
# - phpmax-system-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8phpnext

- name: phpmax-system-mysql8
depends_on: [ phpnext-system-mysql ]
depends_on:
# - phpnext-system-mysql
- phpmax-system-mysql
image: joomlaprojects/docker-images:systemtests8.1
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8phpmax

- name: phpnext-system-postgres
depends_on: [ phpmax-system-mysql8 ]
image: joomlaprojects/docker-images:systemtests8.2
failure: ignore
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" postgresphpnext
# - name: phpnext-system-postgres
# depends_on:
# - phpmax-system-mysql8
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" postgresphpnext

- name: phpmax-system-postgres
depends_on: [ phpnext-system-mysql8 ]
depends_on:
# - phpnext-system-mysql8
- phpmax-system-mysql8
image: joomlaprojects/docker-images:systemtests8.1
failure: ignore
environment:
Expand All @@ -306,17 +317,17 @@ steps:
- name: artifacts-system-tests
image: cschlosser/drone-ftps
depends_on:
- phpnext-system-mysql
- phpnext-system-mysql8
- phpnext-system-postgres
# - phpnext-system-mysql
# - phpnext-system-mysql8
# - phpnext-system-postgres
- phpmax-system-mysql
- phpmax-system-mysql8
- phpmax-system-postgres
- phpmin-system-mysql
- phpmin-system-mysql8
- phpmin-system-postgres
- phpnext-api-mysql
- phpnext-api-postgres
# - phpnext-api-mysql
# - phpnext-api-postgres
- phpmax-api-mysql
- phpmax-api-postgres
- phpmin-api-mysql
Expand Down Expand Up @@ -409,6 +420,6 @@ steps:

---
kind: signature
hmac: e93522732dd8607448fa7705982c42c06f9ebf9762023ed1bb2207ee975fee42
hmac: daa8e5588cc88058bc57aadf35e3d9dd55eefaa9419c457ce374a0dd19eb7cda

...
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public function getItem($pk = null)
$registry = new Registry($item->urls);
$item->urls = $registry->toArray();

$item->articletext = trim($item->fulltext) != '' ? $item->introtext . "<hr id=\"system-readmore\">" . $item->fulltext : $item->introtext;
$item->articletext = ($item->fulltext !== null && trim($item->fulltext) != '') ? $item->introtext . "<hr id=\"system-readmore\">" . $item->fulltext : $item->introtext;

if (!empty($item->id))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class HtmlView extends BaseHtmlView
public function display($tpl = null)
{
$app = Factory::getApplication();
$dashboard = $app->input->getCmd('dashboard');
$dashboard = $app->input->getCmd('dashboard', '');

$position = ApplicationHelper::stringURLSafe($dashboard);

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_joomlaupdate/extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public function enforceMinimumExecutionTime()
return;
}

$sleepMillisec = $minExecTime - $elapsed;
$sleepMillisec = intval($minExecTime - $elapsed);

/**
* If we need to sleep for more than 1 second we should be using sleep() or time_sleep_until() to prevent high
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,12 @@ protected function addToolbar()
*/
public function shouldDisplayPreUpdateCheck()
{
// When the download URL is not found there is no core upgrade path
if (!isset($this->updateInfo['object']->downloadurl->_data))
{
return false;
}

$nextMinor = Version::MAJOR_VERSION . '.' . (Version::MINOR_VERSION + 1);

// Show only when we found a download URL, we have an update and when we update to the next minor or greater.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,32 @@ public function registerProvider(ProviderInterface $provider)
$this->providers[$provider->getID()] = $provider;
}

/**
* Unregister a provider from the ProviderManager.
* When no provider, or null is passed in, then all providers are cleared.
*
* @param ProviderInterface|null $provider The provider to be unregistered
*
* @return void
*
* @since 4.0.6
*/
public function unregisterProvider(ProviderInterface $provider = null): void
{
if ($provider === null)
{
$this->providers = [];
return;
}

if (!array_key_exists($provider->getID(), $this->providers))
{
return;
}

unset($this->providers[$provider->getID()]);
}

/**
* Returns the provider for a particular ID
*
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLAGAIN="Reinstall Joomla core files"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLED="Installed Joomla version"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLUPDATE="Update"
COM_JOOMLAUPDATE_VIEW_DEFAULT_LATEST="Latest Joomla version"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="We can't find a download URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="Update unavailable"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL_DESC="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. Either the update to Joomla %1$s is not available for your stability level or there is a problem with the Joomla Update Server.<br>Please try to download the update package from <a href=\"https://downloads.joomla.org/latest\">the official Joomla download page</a> and use the Upload and Update tab."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE="A new version of the Joomla Update Component is available."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="You must update this component first before you can update Joomla! <a class=\"alert-link\" href=\"index.php?option=com_installer&view=update\">Click here to update the component</a>."
Expand Down
4 changes: 4 additions & 0 deletions administrator/language/en-GB/lib_joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ JLIB_INSTALLER_NOT_ERROR="If the error is related to the installation of TinyMCE
JLIB_INSTALLER_NOTICE_LANG_RESET_USERS="Language set to Default for %d users."
JLIB_INSTALLER_NOTICE_LANG_RESET_USERS_1="Language set to Default for the user."
JLIB_INSTALLER_PURGED_UPDATES="Cleared updates."
JLIB_INSTALLER_SQL_BEGIN="Start of SQL updates."
JLIB_INSTALLER_SQL_BEGIN_SCHEMA="The current database version (schema) is %s."
JLIB_INSTALLER_SQL_END="End of SQL updates."
JLIB_INSTALLER_SQL_END_NOT_COMPLETE="End of SQL updates - INCOMPLETE."
JLIB_INSTALLER_UNINSTALL="Uninstall"
JLIB_INSTALLER_UPDATE="Update"
JLIB_INSTALLER_UPDATE_LOG_QUERY="Ran query from file %1$s. Query text: %2$s."
Expand Down
3 changes: 2 additions & 1 deletion administrator/modules/mod_latest/src/Helper/LatestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public static function getList(Registry &$params, ArticlesModel $model)
{
$item->link = '';

if ($user->authorise('core.edit', 'com_content.article.' . $item->id))
if ($user->authorise('core.edit', 'com_content.article.' . $item->id)
|| ($user->authorise('core.edit.own', 'com_content.article.' . $item->id) && ($userId === $item->created_by)))
{
$item->link = Route::_('index.php?option=com_content&task=article.edit&id=' . $item->id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public static function getList(Registry &$params, ArticlesModel $model)
{
$item->link = '';

if ($user->authorise('core.edit', 'com_content.article.' . $item->id))
if ($user->authorise('core.edit', 'com_content.article.' . $item->id)
|| ($user->authorise('core.edit.own', 'com_content.article.' . $item->id) && ($userId === $item->created_by)))
{
$item->link = Route::_('index.php?option=com_content&task=article.edit&id=' . $item->id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function preprocessSaveData(array $data): array
$extension = $this->getExtensionFromInput();
$data['extension'] = $extension;

// @todo: This is a hack to drop the extension into the global input object - to satisfy how state is built
// TODO: This is a hack to drop the extension into the global input object - to satisfy how state is built
// we should be able to improve this in the future
$this->input->set('extension', $extension);

Expand All @@ -65,7 +65,7 @@ protected function preprocessSaveData(array $data): array
*
* @return integer The record ID on success, false on failure
*
* @since 4.1.0
* @since 4.0.6
*/
protected function save($recordKey = null)
{
Expand Down
29 changes: 24 additions & 5 deletions build/stubGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class StubGenerator extends CliApplication
public function doExecute()
{
$this->createExtensionNamespaceMap();
$contentsByNamespace = [];

$file = "<?php\n";

Expand All @@ -77,18 +78,36 @@ public function doExecute()
$modifier = (!$reflection->isInterface() && $reflection->isFinal()) ? 'final ' : '';
$modifier = ($reflection->isAbstract() && !$reflection->isInterface()) ? $modifier . 'abstract ' : $modifier;

$namespaceSegments = explode('\\', $oldName);
$className = array_pop($namespaceSegments);
$targetNamespace = ltrim(implode('\\', $namespaceSegments), '\\');

// If a deprecated version is available, write a stub class doc block with a deprecated tag
if ($deprecatedVersion !== false)
{
$file .= <<<PHP
/**
* @deprecated $deprecatedVersion Use $newName instead.
*/
$fileContents = <<<PHP
/**
* @deprecated $deprecatedVersion Use $newName instead.
*/
PHP;
}

$file .= "$modifier$type $oldName extends $newName {}\n\n";
$fileContents .= "\t$modifier$type $className extends \\$newName {}\n\n";

if (!array_key_exists($targetNamespace, $contentsByNamespace))
{
$contentsByNamespace[$targetNamespace] = '';
}

$contentsByNamespace[$targetNamespace] .= $fileContents;
}

foreach ($contentsByNamespace as $namespace => $contents)
{
$file .= "namespace $namespace {\n";
$file .= $contents;
$file .= "}\n\n";
}

// And save the file locally
Expand Down
10 changes: 9 additions & 1 deletion components/com_contact/tmpl/category/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Contact\Administrator\Helper\ContactHelper;
Expand Down Expand Up @@ -99,7 +100,14 @@ class="inputbox" onchange="document.adminForm.submit();"
<a href="<?php echo Route::_(RouteHelper::getContactRoute($item->slug, $item->catid, $item->language)); ?>">
<?php if ($this->params->get('show_image_heading')) : ?>
<?php if ($item->image) : ?>
<?php echo HTMLHelper::_('image', $item->image, '', array('class' => 'contact-thumbnail img-thumbnail')); ?>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $item->image,
'alt' => '',
'class' => 'contact-thumbnail img-thumbnail',
]
); ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->escape($item->name); ?>
Expand Down
Loading

0 comments on commit 989c719

Please sign in to comment.