? Language Change bug PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar heelc29
heelc29
2 Apr 2023

Summary of Changes

Fix the creation of the basic step when creating a new tour

// Create default step for new tour
if ($result && $input->getCmd('task') !== 'save2copy' && $this->getState($this->getName() . '.new')) {
$tourId = (int) $this->getState($this->getName() . '.id');
$table = $this->getTable('Step');
$table->id = 0;
$table->title = 'COM_GUIDEDTOURS_BASIC_STEP';
$table->description = '';
$table->tour_id = $tourId;
$table->published = 1;
$table->store();
}

Testing Instructions

Create a new tour

Actual result BEFORE applying this Pull Request

The new tour does not contain steps

database errors:
image
image
image
image
image

Expected result AFTER applying this Pull Request

The tour saves properly, and when going to the steps page, the user is prompted to create a step.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar joomla-cms-bot joomla-cms-bot - change - 2 Apr 2023
Category Administration
avatar heelc29 heelc29 - open - 2 Apr 2023
avatar heelc29 heelc29 - change - 2 Apr 2023
Status New Pending
avatar richard67
richard67 - comment - 2 Apr 2023

@heelc29 I don't get these database errors when creating a new tour on a clean, current 4.3-dev branch after a new installation of Joomla.

Could you describe in detail what you have done to get these errors? And what's your PHP and your database server type (MySQL or MariaDB) and version?

avatar heelc29
heelc29 - comment - 2 Apr 2023

Could you describe in detail what you have done to get these errors?

@richard67 I get it while debugging (xDebug) why no step is created. The exception is caught by the table class but you can check it also with this code

if (!$table->store()) {
    throw new \Exception(implode("\n", $table->getErrors()), 500);
}

image

And what's your PHP and your database server type (MySQL or MariaDB) and version?

image

avatar richard67 richard67 - test_item - 2 Apr 2023 - Tested successfully
avatar richard67
richard67 - comment - 2 Apr 2023

I have tested this item successfully on ecc74a5

I can confirm that without this PR, the basic step doesn't get created when using "save" or "save and new", while it gets created with this PR applied.

I also can confirm that the columns handled by this PR here indeed don't have default values, so they should be set when creating a new record.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40297.

avatar obuisard
obuisard - comment - 2 Apr 2023

Now, I am not sure we really need a basic step here....

avatar chmst
chmst - comment - 21 Apr 2023

Following the instructions I can confirm that the mentioned exceptions are resolved and an first step is stored. But there is still the Message

Column 'ordering' cannot be null

avatar heelc29
heelc29 - comment - 4 May 2023

Column 'ordering' cannot be null

This column should have a default value ?

`ordering` int NOT NULL DEFAULT 0,

Now, I am not sure we really need a basic step here....

@obuisard We can also delete the broken code ...

avatar obuisard
obuisard - comment - 4 May 2023

I would just remove the code that is never executed rather than try fixing it. To me, it does not help to have a pre-installed step when a tour is created.
Right now, the behavior users get is that no step is created when creating a new tour.
We should just leave it like that (the behavior) and remove the code that was supposed to create a new step but is never reached.

avatar heelc29 heelc29 - change - 20 May 2023
Title
[4.3] Guided Tours fix the creation of the basic step when creating a new tour
[4.3] Guided Tours remove broken code for creation of basic step
avatar heelc29 heelc29 - edited - 20 May 2023
avatar joomla-cms-bot joomla-cms-bot - change - 20 May 2023
Category Administration Administration Language & Strings
avatar heelc29 heelc29 - change - 20 May 2023
Labels Added: bug PR-4.3-dev
avatar heelc29
heelc29 - comment - 20 May 2023

remove the code that was supposed to create a new step but is never reached

@obuisard PR updated

avatar obuisard
obuisard - comment - 20 May 2023

remove the code that was supposed to create a new step but is never reached

@obuisard PR updated

Thank you so much @heelc29, really appreciated.

avatar heelc29 heelc29 - change - 26 May 2023
Labels Added: Language Change
avatar khu5h1 khu5h1 - test_item - 25 Jun 2023 - Tested successfully
avatar khu5h1
khu5h1 - comment - 25 Jun 2023

I have tested this item successfully on 0ce5c6b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40297.

avatar obuisard obuisard - test_item - 10 Aug 2023 - Tested successfully
avatar obuisard
obuisard - comment - 10 Aug 2023

I have tested this item successfully on 0ce5c6b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40297.

avatar obuisard obuisard - change - 10 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 10 Aug 2023
avatar Quy Quy - change - 10 Aug 2023
Status Pending Ready to Commit
avatar Quy
Quy - comment - 10 Aug 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40297.

avatar Quy Quy - change - 10 Aug 2023
Labels Added: ?
avatar sdwjoomla sdwjoomla - close - 11 Aug 2023
avatar sdwjoomla sdwjoomla - merge - 11 Aug 2023
avatar sdwjoomla sdwjoomla - change - 11 Aug 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-08-11 13:55:55
Closed_By sdwjoomla
avatar sdwjoomla
sdwjoomla - comment - 11 Aug 2023

Thanks @heelc29

Add a Comment

Login with GitHub to post a comment