Skip to content

Commit

Permalink
Update 4.1 from 4.0 (#36575)
Browse files Browse the repository at this point in the history
* [4.0] Backup message (#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

* [4.0]  xml code style (#36532)

Fixes a few spaces to tabs issues

* [4.0] media manager breadcrumbs (#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 (#36024)

This is a replacement to the merged PR #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 (#36536)

Remove extra div that is not needed

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

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

replace tab with space

code review

* [4.0] archive icon (#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 (#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 (#36542)

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

* Handle when toggle icon is not available

* cs

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

* Fix uploadlimits checks (#36023)

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

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

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

* Fix Codemirror behind tabs (#36140)

* Fix Codemirror behind tabs

* jscs

* Remove dependency on Factory in AdminController

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

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

* Check model is set before calling its methods

* Update OverridesController.php

* Category edit form should use return url (#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 (#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 (#36489)

* [4.0] Code Style (#36564)

* Use an absolute path in image list field (#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 (#36068)

Cache setWorkarounds returns an array not a string

Co-authored-by: Brian Teeman <[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: Harald Leithner <[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]>
  • Loading branch information
14 people authored Jan 5, 2022
1 parent 6c2dfa6 commit 74a225e
Show file tree
Hide file tree
Showing 31 changed files with 295 additions and 203 deletions.
36 changes: 28 additions & 8 deletions administrator/components/com_banners/tmpl/clients/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,40 @@
<?php echo $item->contact; ?>
</td>
<td class="text-center btns d-none d-md-table-cell itemnumber">
<a class="btn <?php echo ($item->count_published > 0) ? 'btn-success' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=1'); ?>">
<?php echo $item->count_published; ?></a>
<a class="btn <?php echo ($item->count_published > 0) ? 'btn-success' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=1'); ?>"
aria-describedby="tip-publish<?php echo $i; ?>">
<?php echo $item->count_published; ?>
</a>
<div role="tooltip" id="tip-publish<?php echo $i; ?>">
<?php echo Text::_('COM_BANNERS_COUNT_PUBLISHED_ITEMS'); ?>
</div>
</td>
<td class="text-center btns d-none d-md-table-cell itemnumber">
<a class="btn <?php echo ($item->count_unpublished > 0) ? 'btn-danger' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=0'); ?>">
<?php echo $item->count_unpublished; ?></a>
<a class="btn <?php echo ($item->count_unpublished > 0) ? 'btn-danger' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=0'); ?>"
aria-describedby="tip-unpublish<?php echo $i; ?>">
<?php echo $item->count_unpublished; ?>
</a>
<div role="tooltip" id="tip-unpublish<?php echo $i; ?>">
<?php echo Text::_('COM_BANNERS_COUNT_UNPUBLISHED_ITEMS'); ?>
</div>
</td>
<td class="text-center btns d-none d-md-table-cell itemnumber">
<a class="btn <?php echo ($item->count_archived > 0) ? 'btn-info' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=2'); ?>">
<?php echo $item->count_archived; ?></a>
<a class="btn <?php echo ($item->count_archived > 0) ? 'btn-info' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=2'); ?>"
aria-describedby="tip-archived<?php echo $i; ?>">
<?php echo $item->count_archived; ?>
</a>
<div role="tooltip" id="tip-archived<?php echo $i; ?>">
<?php echo Text::_('COM_BANNERS_COUNT_ARCHIVED_ITEMS'); ?>
</div>
</td>
<td class="text-center btns d-none d-md-table-cell itemnumber">
<a class="btn <?php echo ($item->count_trashed > 0) ? 'btn-inverse' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=-2'); ?>">
<?php echo $item->count_trashed; ?></a>
<a class="btn <?php echo ($item->count_trashed > 0) ? 'btn-dark' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=-2'); ?>"
aria-describedby="tip-trashed<?php echo $i; ?>">
<?php echo $item->count_trashed; ?>
</a>
<div role="tooltip" id="tip-trashed<?php echo $i; ?>">
<?php echo Text::_('COM_BANNERS_COUNT_TRASHED_ITEMS'); ?>
</div>
</td>
<td class="small d-none d-md-table-cell">
<?php if ($item->purchase_type < 0) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@

<?php echo $this->form->getInput('extension'); ?>
<input type="hidden" name="task" value="">
<input type="hidden" name="return" value="<?php echo $input->getBase64('return'); ?>">
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_content/forms/article.xml
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@

<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="jmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">

<field
name="robots"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ public function getForm($data = array(), $loadData = true)
$record = new \stdClass;

// Get ID of the article from input, for frontend, we use a_id while backend uses id
$articleIdFromInput = (int) $app->input->getInt('a_id') ?: $app->input->getInt('id', 0);
$articleIdFromInput = $app->isClient('site')
? $app->input->getInt('a_id', 0)
: $app->input->getInt('id', 0);

// On edit article, we get ID of article from article.id state, but on save, we use data from input
$id = (int) $this->getState('article.id', $articleIdFromInput);
Expand Down
85 changes: 54 additions & 31 deletions administrator/components/com_installer/src/Model/WarningsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,76 +98,99 @@ public function getItems()
$messages = [];

// 16MB
$minMemory = 16 * 1024 * 1024;
$minLimit = 16 * 1024 * 1024;

$file_uploads = ini_get('file_uploads');

if (!$file_uploads)
{
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADSDISABLED'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADISDISABLEDDESC'));
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADSDISABLED'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADISDISABLEDDESC'),
];
}

$upload_dir = ini_get('upload_tmp_dir');

if (!$upload_dir)
{
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSET'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC'));
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSET'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC'),
];
}
elseif (!is_writable($upload_dir))
{
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLE'),
'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC', $upload_dir));
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLE'),
'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC', $upload_dir),
];
}

$tmp_path = Factory::getApplication()->get('tmp_path');

if (!$tmp_path)
{
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC'));
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC'),
];
}
elseif (!is_writable($tmp_path))
{
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE'),
'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC', $tmp_path));
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE'),
'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC', $tmp_path),
];
}

$memory_limit = $this->return_bytes(ini_get('memory_limit'));

if ($memory_limit < $minMemory && $memory_limit != -1)
if ($memory_limit > -1)
{
// 16MB
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYWARN'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYDESC'));
}
elseif ($memory_limit < ($minMemory * 1.5) && $memory_limit != -1)
{
// 24MB
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYWARN'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYDESC'));
if ($memory_limit < $minLimit)
{
// 16MB
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYWARN'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYDESC'),
];
}
elseif ($memory_limit < ($minLimit * 1.5))
{
// 24MB
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYWARN'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYDESC'),
];
}
}

$post_max_size = $this->return_bytes(ini_get('post_max_size'));
$post_max_size = $this->return_bytes(ini_get('post_max_size'));
$upload_max_filesize = $this->return_bytes(ini_get('upload_max_filesize'));

if ($post_max_size < $upload_max_filesize)
if ($post_max_size > 0 && $post_max_size < $upload_max_filesize)
{
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC'));
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC'),
];
}

if ($post_max_size < $minMemory)
if ($post_max_size > 0 && $post_max_size < $minLimit)
{
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC'));
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC'),
];
}

if ($upload_max_filesize < $minMemory)
if ($upload_max_filesize > 0 && $upload_max_filesize < $minLimit)
{
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC'));
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE'),
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC'),
];
}

return $messages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,19 @@ public function getModel($name = 'Api', $prefix = 'Administrator', $config = [])
*/
private function checkContent()
{
$params = ComponentHelper::getParams('com_media');

$helper = new MediaHelper;
$serverlength = $this->input->server->getInt('CONTENT_LENGTH');

if (($params->get('upload_maxsize', 0) > 0 && $serverlength > ($params->get('upload_maxsize', 0) * 1024 * 1024))
|| $serverlength > $helper->toBytes(ini_get('upload_max_filesize'))
|| $serverlength > $helper->toBytes(ini_get('post_max_size'))
|| $serverlength > $helper->toBytes(ini_get('memory_limit')))
$helper = new MediaHelper;
$contentLength = $this->input->server->getInt('CONTENT_LENGTH');
$params = ComponentHelper::getParams('com_media');
$paramsUploadMaxsize = $params->get('upload_maxsize', 0) * 1024 * 1024;
$uploadMaxFilesize = $helper->toBytes(ini_get('upload_max_filesize'));
$postMaxSize = $helper->toBytes(ini_get('post_max_size'));
$memoryLimit = $helper->toBytes(ini_get('memory_limit'));

if (($paramsUploadMaxsize > 0 && $contentLength > $paramsUploadMaxsize)
|| ($uploadMaxFilesize > 0 && $contentLength > $uploadMaxFilesize)
|| ($postMaxSize > 0 && $contentLength > $postMaxSize)
|| ($memoryLimit > -1 && $contentLength > $memoryLimit)
)
{
throw new \Exception(Text::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'), 403);
}
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/forms/item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
showtime="true"
size="22"
filter="user_utc"
showon="home:0"
showon="home:0"
/>

<field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
{
parent::__construct($config, $factory, $app, $input);

$this->registerTask('unsetDefault', 'setDefault');
$this->registerTask('unsetDefault', 'setDefault');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function __construct(array $config = array(), MVCFactoryInterface $factor
}
}

$this->registerTask('unsetDefault', 'setDefault');
$this->registerTask('unsetDefault', 'setDefault');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
}
}

$this->registerTask('unsetDefault', 'setDefault');
$this->registerTask('unsetDefault', 'setDefault');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ public function setDefault($pk, $value = 1)
if ($value)
{
// Unset other default item
if ($table->load(array('default' => '1')))
if ($table->load(
[
'default' => '1',
'extension' => $table->get('extension')
]
))
{
$table->default = 0;
$table->modified = $date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function check()
}
else
{
$db = $this->getDbo();
$db = $this->getDbo();
$query = $db->getQuery(true);

$query
Expand Down Expand Up @@ -192,7 +192,7 @@ public function store($updateNulls = true)
{
// Existing item
$this->modified_by = $user->id;
$this->modified = $date->toSql();
$this->modified = $date->toSql();
}
else
{
Expand All @@ -219,10 +219,15 @@ public function store($updateNulls = true)
$this->modified_by = $this->created_by;
}

if ($this->default == '1')
if ((int) $this->default === 1)
{
// Verify that the default is unique for this workflow
if ($table->load(array('default' => '1')))
if ($table->load(
[
'default' => '1',
'extension' => $this->extension
]
))
{
$table->default = 0;
$table->store();
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 @@ -59,7 +59,7 @@ COM_JOOMLAUPDATE_SELF_EMPTYSTATE_TITLE="A new version of the Joomla Update Compo
COM_JOOMLAUPDATE_SYSTEM_CHECK="System Check"
COM_JOOMLAUPDATE_TOOLBAR_CHECK="Check for Updates"
COM_JOOMLAUPDATE_UPDATE_CHECK="Update Check"
COM_JOOMLAUPDATE_UPDATE_CONFIRM_BACKUP="I'm prepared for the update and have made a backup."
COM_JOOMLAUPDATE_UPDATE_CONFIRM_BACKUP="I'm prepared for the update and have made a backup of the files and database."
COM_JOOMLAUPDATE_UPDATE_EMPTYSTATE_TITLE="Update your site to \"Joomla! %s\""
COM_JOOMLAUPDATE_UPDATE_EMPTYSTATE_BUTTON_ADD="Start update"
COM_JOOMLAUPDATE_UPDATE_LOG_CLEANUP="Cleaning up after installation."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ protected function save($recordKey = null)
/** @var \Joomla\CMS\MVC\Model\AdminModel $model */
$model = $this->getModel(Inflector::singularize($this->contentType));

$model->setState('filter.language', $this->input->post->get('lang_code'));
$model->setState('filter.client', $this->input->post->get('app'));

if (!$model)
{
throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_MODEL_CREATE'));
}

$model->setState('filter.language', $this->input->post->get('lang_code'));
$model->setState('filter.client', $this->input->post->get('app'));

$data = $this->input->get('data', json_decode($this->input->json->getRaw(), true), 'array');

// TODO: Not the cleanest thing ever but it works...
Expand Down
Loading

0 comments on commit 74a225e

Please sign in to comment.