Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
64dffed
Release Joomla! 5.2.0 Beta 3
Hackwar Sep 13, 2024
ef04713
Revert to dev
Hackwar Sep 13, 2024
278ba68
Resetting to 5.2.0-rc1
Hackwar Sep 17, 2024
4c0d21b
Resetting to 5.2.0-rc1-dev
Hackwar Sep 17, 2024
4de70ec
Merge remote-tracking branch 'origin/5.2-dev' into 5.2-dev
Hackwar Sep 17, 2024
204e5b0
[5.2] [Guided Tours] The 'Welcome' tour contains unescaped quotes in …
obuisard Sep 18, 2024
86e00ce
[5.2] [Guided tours] Bug fixes for PR #43966 (#44075)
tecpromotion Sep 18, 2024
bb6aade
[5.2] [Guided Tours] Better tour user state wording and explanation (…
obuisard Sep 18, 2024
f104a8c
[5.2] Created translatable strings for LocalAdapter.php "code review"…
webmasterab Sep 18, 2024
e5ac549
[5.2] [Guided Tours] Fix permission errors when recording user tour s…
obuisard Sep 18, 2024
f08a6ab
[5.2] [Guided Tours] Fix content and footer padding (#44104)
obuisard Sep 18, 2024
1075711
[5.2] fix unescaped quotes in sampldata_blog language string (#44111)
tecpromotion Sep 18, 2024
c5810f2
[5.2] [Guided Tours] unescaped quotes in a language string (#44110)
tecpromotion Sep 18, 2024
c12ddb8
[4.4] Fix next exec calculation for task scheduler (#44061)
rdeutz Sep 20, 2024
2f7cd02
[4.4] [Guided Tours] The categories tour is not visible to Managers (…
obuisard Sep 20, 2024
7b5b790
Added com_content when adding a category (#44117)
obuisard Sep 22, 2024
91e1afc
[5.2] fix sql for postgres (#44123)
alikon Sep 22, 2024
4c9786f
Fix start=0 in the pagination (#44069)
Fedik Sep 22, 2024
d4a1f41
[4.4] Check pagination parameters from request, another try (#44023)
Fedik Sep 23, 2024
b1b0a59
[5.2] [Guided Tours] Addition of 'Auto start' step in 'How to create …
obuisard Sep 23, 2024
e4e6e8b
[4.4] Update .drone.yml (#44107)
brianteeman Sep 23, 2024
6043567
fix event target in menu.js (#44019)
SniperSister Sep 23, 2024
e4fb51a
[5.2] [Guided Tours] Global Configuration delay field fix (#44091)
obuisard Sep 23, 2024
3e2f31d
Merge branch 'refs/heads/4.4-dev' into 44-52-upmerge-20240923
Hackwar Sep 23, 2024
6f9afaa
Signing .drone.yml
Hackwar Sep 23, 2024
1c95625
Merge pull request #44126 from Hackwar/44-52-upmerge-20240923
Hackwar Sep 23, 2024
f5ba507
[5.2] Updating dev dependencies (#44125)
Hackwar Sep 23, 2024
8f37e3c
Fix ActionLog duplicated query while language loading (#44077)
Fedik Sep 25, 2024
0461c99
[4.x] Fix settings component parameters of menuitems via API (#44119)
SniperSister Sep 25, 2024
8f3045a
[4.x] Translation Update (#44147)
joomla-translation-bot Sep 27, 2024
696ed42
[5.2] Translation Update (#44146)
joomla-translation-bot Sep 27, 2024
0b1867c
[5.2] Fix filtering exclude and include articles (#44142)
rdeutz Sep 27, 2024
4f3415a
Remove forgotten 'card-link' parameter from field and blog sample dat…
drmenzelit Sep 27, 2024
5fdf00c
Option to show all articles in the new mod_articles (#44127)
RickR2H Sep 27, 2024
1745bb9
Added plugin event triggers to the new mod_articles module (#44132)
RickR2H Sep 27, 2024
ea1a413
Articles Module: (Re)Introduced dynamic mode as on mod_articles_categ…
drmenzelit Sep 28, 2024
15e03a3
Module Articles show only articles from current user (#44137)
RickR2H Sep 28, 2024
d489646
Fix showon for Trigger Plugin Events in mod_articles (#44155)
RickR2H Sep 29, 2024
9f544f9
Article module fix read more title (#44136)
RickR2H Sep 29, 2024
809ee6a
Merge branch '4.4-dev' into 5.2-dev-upmerge-2024-09-29
richard67 Sep 29, 2024
d5c026c
[5.2] Update NPM developer dependency "rollup" from 2.79.1 to 2.79.2 …
richard67 Sep 29, 2024
27c1e6d
Merge branch '5.2-dev' into 5.2-dev-upmerge-2024-09-29
richard67 Sep 29, 2024
9c9cb99
Merge pull request #44158 from richard67/5.2-dev-upmerge-2024-09-29
Hackwar Sep 29, 2024
20cfbbf
[5.2] Fix saving edited images in media manager (#44160)
Hackwar Sep 29, 2024
d88589d
Release Joomla! 5.2.0 Release Candidate 1
Hackwar Sep 29, 2024
b067fe7
Revert to dev
Hackwar Oct 1, 2024
38c7689
Merge branch '5.2-dev' into 5.3-dev-upmerge-2024-10-03
richard67 Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ public static function getContentTypeLink($component, $contentType, $id, $urlVar
*/
public static function loadActionLogPluginsLanguage()
{
static $loaded;
if ($loaded) {
return;
}
$loaded = true;

$lang = Factory::getLanguage();
$db = Factory::getDbo();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
UPDATE `#__guidedtour_steps`
SET `ordering` = `ordering` + 1
WHERE `title` IN ('COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_SAVECLOSE_TITLE', 'COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_CONGRATULATIONS_TITLE');

INSERT INTO `#__guidedtour_steps` (`title`, `description`, `position`, `target`, `type`, `interactive_type`, `url`, `published`, `language`, `note`, `tour_id`, `created`, `created_by`, `modified`, `modified_by`, `ordering`)
SELECT 'COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_AUTOSTART_TITLE', 'COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_AUTOSTART_DESCRIPTION', 'bottom', '#jform_autostart0', 2, 3, '', 1, '*', '', `tour_id`, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, `ordering` + 1
FROM `#__guidedtour_steps`
WHERE `title` = 'COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_COMPONENT_TITLE';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--
-- Add the Guided Tours selectable option to the User Action Logs
--
INSERT INTO "#__action_logs_extensions" ("extension") VALUES ("com_guidedtours");
INSERT INTO "#__action_logs_extensions" ("extension") VALUES ('com_guidedtours');

INSERT INTO "#__action_log_config" ("type_title", "type_alias", "id_holder", "title_holder", "table_name", "text_prefix") VALUES
('guidedtour', 'com_guidedtours.state', 'id', 'title', '#__guidedtours', 'PLG_ACTIONLOG_JOOMLA');
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
UPDATE "#__guidedtour_steps"
SET "ordering" = "ordering" + 1
WHERE "title" IN ('COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_SAVECLOSE_TITLE', 'COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_CONGRATULATIONS_TITLE');

INSERT INTO "#__guidedtour_steps" ("title", "description", "position", "target", "type", "interactive_type", "url", "published", "language", "note", "tour_id", "created", "created_by", "modified", "modified_by", "ordering")
SELECT 'COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_AUTOSTART_TITLE', 'COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_AUTOSTART_DESCRIPTION', 'bottom', '#jform_autostart0', 2, 3, '', 1, '*', '', "tour_id", CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, "ordering" + 1
FROM "#__guidedtour_steps"
WHERE "title" = 'COM_GUIDEDTOURS_TOUR_GUIDEDTOURS_STEP_COMPONENT_TITLE';
6 changes: 4 additions & 2 deletions administrator/components/com_guidedtours/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

<field
name="delayed_time"
type="text"
type="number"
label="COM_GUIDEDTOURS_CONFIG_DELAYED_TIME_LABEL"
description="COM_GUIDEDTOURS_CONFIG_DELAYED_TIME_DESCRIPTION"
default="60"
size="small"
min="1"
filter="integer"
validate="number"
showon="allowTourAutoStart:1"
/>
</fieldset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,87 +38,90 @@ public function fetchUserState()
$user = $this->app->getIdentity();

$tourId = $this->app->input->getInt('tid', 0);
$stepNumber = $this->app->input->getString('sid', '');
$stepNumber = $this->app->input->getInt('sid', 0);
$context = $this->app->input->getString('context', '');

if ($user != null && $user->id > 0) {
$actionState = '';

switch ($context) {
case 'tour.complete':
$actionState = 'completed';
break;
case 'tour.cancel':
$actionState = 'delayed';
break;
case 'tour.skip':
$actionState = 'skipped';
break;
}
if ($user == null || $user->id <= 0) {
echo new JsonResponse(['success' => false, 'tourId' => $tourId], Text::_('COM_GUIDEDTOURS_USERSTATE_CONNECTEDONLY'), true);
$this->app->close();
}

if (!\in_array($context, ['tour.complete', 'tour.cancel', 'tour.skip'])) {
echo new JsonResponse(['success' => false, 'tourId' => $tourId], Text::_('COM_GUIDEDTOURS_USERSTATE_WRONGCONTEXT'), true);
$this->app->close();
}

PluginHelper::importPlugin('guidedtours');

// event onBeforeTourSaveUserState before save user tour state
$beforeEvent = AbstractEvent::create(
'onBeforeTourSaveUserState',
[
'subject' => new \stdClass(),
'tourId' => $tourId,
'actionState' => $actionState,
'stepNumber' => $stepNumber,
]
);

$this->app->getDispatcher()->dispatch('onBeforeTourSaveUserState', $beforeEvent);

// Save the tour state only when the tour auto-starts.
$tourModel = $this->getModel('Tour', 'Administrator');
if ($tourModel->isAutostart($tourId)) {
$result = $tourModel->saveTourUserState($tourId, $actionState);
if ($result) {
$message = Text::sprintf('COM_GUIDEDTOURS_USERSTATE_STATESAVED', $user->id, $tourId);
} else {
$message = Text::sprintf('COM_GUIDEDTOURS_USERSTATE_STATENOTSAVED', $user->id, $tourId);
}
if ($tourId <= 0) {
echo new JsonResponse(['success' => false, 'tourId' => $tourId], Text::_('COM_GUIDEDTOURS_USERSTATE_BADTOURID'), true);
$this->app->close();
}

$actionState = '';

switch ($context) {
case 'tour.complete':
$actionState = 'completed';
break;
case 'tour.cancel':
$actionState = 'delayed';
break;
case 'tour.skip':
$actionState = 'skipped';
break;
}

PluginHelper::importPlugin('guidedtours');

// event onBeforeTourSaveUserState before save user tour state
$beforeEvent = AbstractEvent::create(
'onBeforeTourSaveUserState',
[
'subject' => new \stdClass(),
'tourId' => $tourId,
'actionState' => $actionState,
'stepNumber' => $stepNumber,
]
);

$this->app->getDispatcher()->dispatch('onBeforeTourSaveUserState', $beforeEvent);

// Save the tour state only when the tour auto-starts.
$tourModel = $this->getModel('Tour', 'Administrator');
if ($tourModel->isAutostart($tourId)) {
$result = $tourModel->saveTourUserState($tourId, $actionState);
if ($result) {
$message = Text::sprintf('COM_GUIDEDTOURS_USERSTATE_STATESAVED', $user->id, $tourId);
} else {
$result = false;
$message = Text::sprintf('COM_GUIDEDTOURS_USERSTATE_STATENOTSAVED', $user->id, $tourId);
}

// event onAfterTourSaveUserState after save user tour state (may override message)
$afterEvent = AbstractEvent::create(
'onAfterTourSaveUserState',
[
'subject' => new \stdClass(),
'tourId' => $tourId,
'actionState' => $actionState,
'stepNumber' => $stepNumber,
'result' => $result,
'message' => &$message,
]
);

$this->app->getDispatcher()->dispatch('onAfterTourSaveUserState', $afterEvent);

// Construct the response data
$data = [
'tourId' => $tourId,
'stepId' => $stepNumber,
'context' => $context,
'state' => $actionState,
];
echo new JsonResponse($data, $message);
$this->app->close();
} else {
// Construct the response data
$data = [
'success' => false,
'tourId' => $tourId,
];

$message = Text::_('COM_GUIDEDTOURS_USERSTATE_CONNECTEDONLY');
echo new JsonResponse($data, $message, true);
$this->app->close();
$result = false;
$message = Text::sprintf('COM_GUIDEDTOURS_USERSTATE_STATENOTSAVED', $user->id, $tourId);
}

// event onAfterTourSaveUserState after save user tour state (may override message)
$afterEvent = AbstractEvent::create(
'onAfterTourSaveUserState',
[
'subject' => new \stdClass(),
'tourId' => $tourId,
'actionState' => $actionState,
'stepNumber' => $stepNumber,
'result' => $result,
'message' => &$message,
]
);

$this->app->getDispatcher()->dispatch('onAfterTourSaveUserState', $afterEvent);

// Construct the response data
$data = [
'tourId' => $tourId,
'stepId' => $stepNumber,
'context' => $context,
'state' => $actionState,
];
echo new JsonResponse($data, $message);
$this->app->close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

/**
* @package Joomla.Administrator
* @subpackage com_guidedtours
*
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Guidedtours\Administrator\Dispatcher;

use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Dispatcher\ComponentDispatcher;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* ComponentDispatcher class for com_guidedtours
*
* @since 5.2.0
*/
class Dispatcher extends ComponentDispatcher
{
/**
* Method to check component access permission
*
* @return void
*
* @throws \Exception|NotAllowed
*/
protected function checkAccess()
{
$command = $this->input->getCmd('task', 'display');
if ($this->app->isClient('administrator') && $command == 'ajax.fetchUserState') {
return;
}

parent::checkAccess();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function putFiles()
$move = $content->get('move', true);

if ($mediaContent != null) {
$this->checkContent();
$this->checkFileSize(\strlen($mediaContent));

$this->getModel()->updateFile($adapter, $name, str_replace($name, '', $path), $mediaContent);
}
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/src/Model/ItemModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ protected function populateState()

$this->setState('item.type', $type);

$link = $app->isClient('api') ? $app->getInput()->get('link') :
$link = $app->isClient('api') ? $app->getInput()->get('link', null, 'string') :
$app->getUserState('com_menus.edit.item.link');

if ($link) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,46 @@ private function getFromTask(string $property, $default = null)
*/
public function nextExec(bool $string = true, bool $basisNow = false)
{
// Exception handling here
switch ($this->type) {
case 'interval':
$lastExec = Factory::getDate($basisNow ? 'now' : $this->getFromTask('last_execution'), 'UTC');
$interval = new \DateInterval($this->rule->exp);
$nextExec = $lastExec->add($interval);
$executionRules = $this->getFromTask('execution_rules');
$type = $executionRules['rule-type'];
switch ($type) {
case 'interval-minutes':
$now = Factory::getDate('now', 'UTC');
$intervalMinutes = (int) $executionRules['interval-minutes'];
$interval = new \DateInterval('PT' . $intervalMinutes . 'M');
$nextExec = $now->add($interval);
$nextExec = $string ? $nextExec->toSql() : $nextExec;
break;
case 'interval-hours':
$now = Factory::getDate('now', 'UTC');
$intervalHours = $executionRules['interval-hours'];
$interval = new \DateInterval('PT' . $intervalHours . 'H');
$nextExec = $now->add($interval);
$nextExec = $string ? $nextExec->toSql() : $nextExec;
break;
case 'interval-days':
$now = Factory::getDate('now', 'UTC');
$intervalDays = $executionRules['interval-days'];
$interval = new \DateInterval('P' . $intervalDays . 'D');
$nextExec = $now->add($interval);
$execTime = $executionRules['exec-time'];
list($hour, $minute) = explode(':', $execTime);
$nextExec->setTime($hour, $minute);
$nextExec = $string ? $nextExec->toSql() : $nextExec;
break;
case 'interval-months':
$now = Factory::getDate('now', 'UTC');
$intervalMonths = $executionRules['interval-months'];
$interval = new \DateInterval('P' . $intervalMonths . 'M');
$nextExec = $now->add($interval);
$execDay = $executionRules['exec-day'];
$nextExecYear = $nextExec->format('Y');
$nextExecMonth = $nextExec->format('n');
$nextExec->setDate($nextExecYear, $nextExecMonth, $execDay);

$execTime = $executionRules['exec-time'];
list($hour, $minute) = explode(':', $execTime);
$nextExec->setTime($hour, $minute);
$nextExec = $string ? $nextExec->toSql() : $nextExec;
break;
case 'cron-expression':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public function getTask(array $options = []): ?\stdClass
*
* @param \JDatabaseDriver $db The database driver to use.
* @return bool True if there are running tasks, false otherwise.
* @since __DEPLOY_VERSION__
* @since 4.4.9
*/
private function hasRunningTasks($db): bool
{
Expand Down Expand Up @@ -445,7 +445,7 @@ private function hasRunningTasks($db): bool
* - allowDisabled: Whether to allow disabled tasks.
* - id: The ID of the task.
* @return Query The lock query.
* @since __DEPLOY_VERSION__
* @since 5.2.0
*/
private function buildLockQuery($db, $now, $options)
{
Expand Down Expand Up @@ -489,7 +489,7 @@ static function (TaskOption $taskOption): string {
* - allowDisabled: Whether to allow disabled tasks.
* @return array The ID of the next task, or an empty array if no task is found.
*
* @since __DEPLOY_VERSION__
* @since 5.2.0
* @throws \RuntimeException If there is an error executing the query.
*/
private function getNextTaskId($db, $now, $options)
Expand Down Expand Up @@ -537,7 +537,7 @@ static function (TaskOption $taskOption): string {
* @param \JDatabaseDriver $db The database driver to use.
* @param string $now The current time in the database's time format.
* @return \stdClass|null The fetched task object, or null if no task was found.
* @since __DEPLOY_VERSION__
* @since 5.2.0
* @throws \RuntimeException If there was an error executing the query.
*/
private function fetchTask($db, $now): ?\stdClass
Expand Down
9 changes: 6 additions & 3 deletions administrator/language/en-GB/com_guidedtours.ini
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ COM_GUIDEDTOURS_TYPE_REDIRECT_URL_DESC="Enter the relative URL of the page you w
COM_GUIDEDTOURS_TYPE_REDIRECT_URL_LABEL="Relative URL"
COM_GUIDEDTOURS_URL_LABEL="Relative URL"
COM_GUIDEDTOURS_URL_DESC="Enter the relative URL of the page from where you want to Start the tour, e.g administrator/index.php?option=com_guidedtours&view=tours for the tours' list page."
COM_GUIDEDTOURS_USERSTATE_CONNECTEDONLY="Tour User state action is only for connected users."
COM_GUIDEDTOURS_USERSTATE_STATENOTSAVED="Tour User state not saved for user %1$s tour %2$s."
COM_GUIDEDTOURS_USERSTATE_STATESAVED="Tour User state saved for user %1$s tour %2$s."
COM_GUIDEDTOURS_USERSTATE_BADTOURID="The Tour needs to have a positive id."
; 'Tour User states' are conditions in which a guided tour user leaves a tour, either by cancelling, completing or skipping a tour.
COM_GUIDEDTOURS_USERSTATE_CONNECTEDONLY="The recording of User states for a tour is only available to logged-in users."
COM_GUIDEDTOURS_USERSTATE_STATENOTSAVED="The User state was not saved for user %1$s tour %2$s."
COM_GUIDEDTOURS_USERSTATE_STATESAVED="The User state was saved for user %1$s tour %2$s."
COM_GUIDEDTOURS_USERSTATE_WRONGCONTEXT="The Tour User state context is incorrect."
COM_GUIDEDTOURS_XML_DESCRIPTION="Component for managing Guided Tours functionality."
Loading