Skip to content

Commit 89ff152

Browse files
authored
Merge branch '4.1-dev' into 4.1-dev-child-with-existing-styles
2 parents ba165b0 + c411214 commit 89ff152

File tree

71 files changed

+1796
-1466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1796
-1466
lines changed

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

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,40 @@
123123
<?php echo $item->contact; ?>
124124
</td>
125125
<td class="text-center btns d-none d-md-table-cell itemnumber">
126-
<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'); ?>">
127-
<?php echo $item->count_published; ?></a>
126+
<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'); ?>"
127+
aria-describedby="tip-publish<?php echo $i; ?>">
128+
<?php echo $item->count_published; ?>
129+
</a>
130+
<div role="tooltip" id="tip-publish<?php echo $i; ?>">
131+
<?php echo Text::_('COM_BANNERS_COUNT_PUBLISHED_ITEMS'); ?>
132+
</div>
128133
</td>
129134
<td class="text-center btns d-none d-md-table-cell itemnumber">
130-
<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'); ?>">
131-
<?php echo $item->count_unpublished; ?></a>
135+
<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'); ?>"
136+
aria-describedby="tip-unpublish<?php echo $i; ?>">
137+
<?php echo $item->count_unpublished; ?>
138+
</a>
139+
<div role="tooltip" id="tip-unpublish<?php echo $i; ?>">
140+
<?php echo Text::_('COM_BANNERS_COUNT_UNPUBLISHED_ITEMS'); ?>
141+
</div>
132142
</td>
133143
<td class="text-center btns d-none d-md-table-cell itemnumber">
134-
<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'); ?>">
135-
<?php echo $item->count_archived; ?></a>
144+
<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'); ?>"
145+
aria-describedby="tip-archived<?php echo $i; ?>">
146+
<?php echo $item->count_archived; ?>
147+
</a>
148+
<div role="tooltip" id="tip-archived<?php echo $i; ?>">
149+
<?php echo Text::_('COM_BANNERS_COUNT_ARCHIVED_ITEMS'); ?>
150+
</div>
136151
</td>
137152
<td class="text-center btns d-none d-md-table-cell itemnumber">
138-
<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'); ?>">
139-
<?php echo $item->count_trashed; ?></a>
153+
<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'); ?>"
154+
aria-describedby="tip-trashed<?php echo $i; ?>">
155+
<?php echo $item->count_trashed; ?>
156+
</a>
157+
<div role="tooltip" id="tip-trashed<?php echo $i; ?>">
158+
<?php echo Text::_('COM_BANNERS_COUNT_TRASHED_ITEMS'); ?>
159+
</div>
140160
</td>
141161
<td class="small d-none d-md-table-cell">
142162
<?php if ($item->purchase_type < 0) : ?>

administrator/components/com_categories/tmpl/category/edit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124

125125
<?php echo $this->form->getInput('extension'); ?>
126126
<input type="hidden" name="task" value="">
127+
<input type="hidden" name="return" value="<?php echo $input->getBase64('return'); ?>">
127128
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>">
128129
<?php echo HTMLHelper::_('form.token'); ?>
129130
</div>

administrator/components/com_content/forms/article.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@
909909

910910
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
911911
<fieldset name="jmetadata"
912-
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
912+
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
913913

914914
<field
915915
name="robots"

administrator/components/com_content/src/Model/ArticleModel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,9 @@ public function getForm($data = array(), $loadData = true)
499499
$record = new \stdClass;
500500

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

504506
// On edit article, we get ID of article from article.id state, but on save, we use data from input
505507
$id = (int) $this->getState('article.id', $articleIdFromInput);

administrator/components/com_fields/src/Plugin/FieldsPlugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form
200200
$node->setAttribute('hint', $field->params->get('hint', ''));
201201
$node->setAttribute('required', $field->required ? 'true' : 'false');
202202

203+
if ($layout = $field->params->get('form_layout'))
204+
{
205+
$node->setAttribute('layout', $layout);
206+
}
207+
203208
if ($field->default_value !== '')
204209
{
205210
$defaultNode = $node->appendChild(new \DOMElement('default'));

administrator/components/com_installer/src/Model/WarningsModel.php

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -98,76 +98,99 @@ public function getItems()
9898
$messages = [];
9999

100100
// 16MB
101-
$minMemory = 16 * 1024 * 1024;
101+
$minLimit = 16 * 1024 * 1024;
102102

103103
$file_uploads = ini_get('file_uploads');
104104

105105
if (!$file_uploads)
106106
{
107-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADSDISABLED'),
108-
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADISDISABLEDDESC'));
107+
$messages[] = [
108+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADSDISABLED'),
109+
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_FILEUPLOADISDISABLEDDESC'),
110+
];
109111
}
110112

111113
$upload_dir = ini_get('upload_tmp_dir');
112114

113115
if (!$upload_dir)
114116
{
115-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSET'),
116-
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC'));
117+
$messages[] = [
118+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSET'),
119+
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC'),
120+
];
117121
}
118122
elseif (!is_writable($upload_dir))
119123
{
120-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLE'),
121-
'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC', $upload_dir));
124+
$messages[] = [
125+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLE'),
126+
'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC', $upload_dir),
127+
];
122128
}
123129

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

126132
if (!$tmp_path)
127133
{
128-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET'),
129-
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC'));
134+
$messages[] = [
135+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET'),
136+
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC'),
137+
];
130138
}
131139
elseif (!is_writable($tmp_path))
132140
{
133-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE'),
134-
'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC', $tmp_path));
141+
$messages[] = [
142+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE'),
143+
'description' => Text::sprintf('COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC', $tmp_path),
144+
];
135145
}
136146

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

139-
if ($memory_limit < $minMemory && $memory_limit != -1)
149+
if ($memory_limit > -1)
140150
{
141-
// 16MB
142-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYWARN'),
143-
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYDESC'));
144-
}
145-
elseif ($memory_limit < ($minMemory * 1.5) && $memory_limit != -1)
146-
{
147-
// 24MB
148-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYWARN'),
149-
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYDESC'));
151+
if ($memory_limit < $minLimit)
152+
{
153+
// 16MB
154+
$messages[] = [
155+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYWARN'),
156+
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_LOWMEMORYDESC'),
157+
];
158+
}
159+
elseif ($memory_limit < ($minLimit * 1.5))
160+
{
161+
// 24MB
162+
$messages[] = [
163+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYWARN'),
164+
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_MEDMEMORYDESC'),
165+
];
166+
}
150167
}
151168

152-
$post_max_size = $this->return_bytes(ini_get('post_max_size'));
169+
$post_max_size = $this->return_bytes(ini_get('post_max_size'));
153170
$upload_max_filesize = $this->return_bytes(ini_get('upload_max_filesize'));
154171

155-
if ($post_max_size < $upload_max_filesize)
172+
if ($post_max_size > 0 && $post_max_size < $upload_max_filesize)
156173
{
157-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST'),
158-
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC'));
174+
$messages[] = [
175+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST'),
176+
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC'),
177+
];
159178
}
160179

161-
if ($post_max_size < $minMemory)
180+
if ($post_max_size > 0 && $post_max_size < $minLimit)
162181
{
163-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE'),
164-
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC'));
182+
$messages[] = [
183+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE'),
184+
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC'),
185+
];
165186
}
166187

167-
if ($upload_max_filesize < $minMemory)
188+
if ($upload_max_filesize > 0 && $upload_max_filesize < $minLimit)
168189
{
169-
$messages[] = array('message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE'),
170-
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC'));
190+
$messages[] = [
191+
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE'),
192+
'description' => Text::_('COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC'),
193+
];
171194
}
172195

173196
return $messages;

administrator/components/com_media/src/Controller/ApiController.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,19 @@ public function getModel($name = 'Api', $prefix = 'Administrator', $config = [])
359359
*/
360360
private function checkContent()
361361
{
362-
$params = ComponentHelper::getParams('com_media');
363-
364-
$helper = new MediaHelper;
365-
$serverlength = $this->input->server->getInt('CONTENT_LENGTH');
366-
367-
if (($params->get('upload_maxsize', 0) > 0 && $serverlength > ($params->get('upload_maxsize', 0) * 1024 * 1024))
368-
|| $serverlength > $helper->toBytes(ini_get('upload_max_filesize'))
369-
|| $serverlength > $helper->toBytes(ini_get('post_max_size'))
370-
|| $serverlength > $helper->toBytes(ini_get('memory_limit')))
362+
$helper = new MediaHelper;
363+
$contentLength = $this->input->server->getInt('CONTENT_LENGTH');
364+
$params = ComponentHelper::getParams('com_media');
365+
$paramsUploadMaxsize = $params->get('upload_maxsize', 0) * 1024 * 1024;
366+
$uploadMaxFilesize = $helper->toBytes(ini_get('upload_max_filesize'));
367+
$postMaxSize = $helper->toBytes(ini_get('post_max_size'));
368+
$memoryLimit = $helper->toBytes(ini_get('memory_limit'));
369+
370+
if (($paramsUploadMaxsize > 0 && $contentLength > $paramsUploadMaxsize)
371+
|| ($uploadMaxFilesize > 0 && $contentLength > $uploadMaxFilesize)
372+
|| ($postMaxSize > 0 && $contentLength > $postMaxSize)
373+
|| ($memoryLimit > -1 && $contentLength > $memoryLimit)
374+
)
371375
{
372376
throw new \Exception(Text::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'), 403);
373377
}

administrator/components/com_menus/forms/item.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
showtime="true"
9898
size="22"
9999
filter="user_utc"
100-
showon="home:0"
100+
showon="home:0"
101101
/>
102102

103103
<field

administrator/components/com_menus/src/Controller/ItemsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
4141
{
4242
parent::__construct($config, $factory, $app, $input);
4343

44-
$this->registerTask('unsetDefault', 'setDefault');
44+
$this->registerTask('unsetDefault', 'setDefault');
4545
}
4646

4747
/**

administrator/components/com_scheduler/src/Model/TaskModel.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Joomla\Component\Scheduler\Administrator\Helper\ExecRuleHelper;
2929
use Joomla\Component\Scheduler\Administrator\Helper\SchedulerHelper;
3030
use Joomla\Component\Scheduler\Administrator\Table\TaskTable;
31+
use Joomla\Component\Scheduler\Administrator\Task\TaskOption;
3132
use Joomla\Database\ParameterType;
3233
use Symfony\Component\OptionsResolver\Exception\AccessException;
3334
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
@@ -413,6 +414,18 @@ public function getTask(array $options = []): ?\stdClass
413414
->set($db->quoteName('locked') . ' = :now1')
414415
->bind(':now1', $now);
415416

417+
// Array of all active routine ids
418+
$activeRoutines = array_map(
419+
static function (TaskOption $taskOption): string
420+
{
421+
return $taskOption->type;
422+
},
423+
SchedulerHelper::getTaskOptions()->options
424+
);
425+
426+
// "Orphaned" tasks are not a part of the task queue!
427+
$lockQuery->whereIn($db->quoteName('type'), $activeRoutines, ParameterType::STRING);
428+
416429
// If directed, exclude CLI exclusive tasks
417430
if (!$options['includeCliExclusive'])
418431
{

0 commit comments

Comments
 (0)