? bug ? PR-4.3-dev ? Pending

User tests: Successful: Unsuccessful:

avatar Kaushik1216
Kaushik1216
2 Jan 2023

Pull Request for Issue #39480.

Summary of Changes

Add extension parameter in createTemplate static function.So that a new record will insert into database after creating email template.

Testing Instructions

Just make same change as in this PR and create a mail-template and see mail-template after saving in database.

Actual result BEFORE applying this Pull Request

After creating mail-template a new record not inserted into database in mail template table

Expected result AFTER applying this Pull Request

After this changes on creating mail-template a new record inserted into database in main template table.

Link to documentations

Please select:

  • [ok] No documentation changes for docs.joomla.org needed

  • [ok] No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 2 Jan 2023
Category Libraries
avatar Kaushik1216 Kaushik1216 - open - 2 Jan 2023
avatar Kaushik1216 Kaushik1216 - change - 2 Jan 2023
Status New Pending
avatar richard67
richard67 - comment - 2 Jan 2023

@Kaushik1216 Please fix the code style (PHPCS) errors reported here: https://ci.joomla.org/joomla/joomla-cms/60462/1/6 . Thanks in advance.

avatar Fedik
Fedik - comment - 2 Jan 2023

Sorry, but this almost the same as we have here #37898, also the first one #37898 will be slightly better.

avatar Kaushik1216 Kaushik1216 - change - 2 Jan 2023
Labels Added: ?
avatar Kaushik1216
Kaushik1216 - comment - 2 Jan 2023

Sorry, but this almost the same as we have here #37898, also the first one #37898 will be slightly better.

yes,you are right @Fedik .As I am beginner in joomla-cms contribution so I have less idea about improving code .So please tell me any improvement to this issue if you have !

avatar ReLater
ReLater - comment - 2 Jan 2023

@Kaushik1216

As I am beginner in joomla-cms contribution so I have less idea about improving code .So please tell me any improvement to this issue if you have !

The first fix that is needed in your branch at https://github.com/Kaushik1216/joomla-cms/blob/4.2-dev/libraries/src/Mail/MailTemplate.php#L388:

  • A new method parameter $extension is not allowed at the moment. Remove it!

The second is:

  • Get $template->extension by using the $key!

$template->extension = explode('.', $key)[0];

But please be aware that I only collected the comments of others here; concerning backwards compatibility.

avatar Kaushik1216
Kaushik1216 - comment - 2 Jan 2023

@Kaushik1216

As I am beginner in joomla-cms contribution so I have less idea about improving code .So please tell me any improvement to this issue if you have !

The first fix that is needed in your branch at https://github.com/Kaushik1216/joomla-cms/blob/4.2-dev/libraries/src/Mail/MailTemplate.php#L388:

  • A new method parameter $extension is not allowed at the moment. Remove it!

The second is:

  • Get $template->extension by using the $key!

$template->extension = explode('.', $key)[0];

But please be aware that I only collected the comments of others here; concerning backwards compatibility.

this also working .Should I change this in my PR ?

avatar richard67
richard67 - comment - 2 Jan 2023

this also working .Should I change this in my PR ?

@Kaushik1216 There is an older PR for the same thing, as already discussed. The same proposal has been made to the author of that PR, see #37898 (comment) . If he does not want to change his PR, then feel free to take over and continue with yours. But if he will make that change, we will use his PR because he was first.

In general it is not very friendly just to take over the work from another PR if the author hasn't abandoned his PR, and it's also not very effective if several people are doing the same (or nearly the same) for the same issue.

avatar garkell
garkell - comment - 4 Jan 2023

Tested the
$template->extension = explode('.', $key)[0];
works perfectly, but we still need to remove the tags array() wrap because we are sending an assoc array as the parameter. So line 401 needs to be
$params->tags = $tags;
OR edit the comment at the head of the function to state csv string of variable names.

avatar Kaushik1216
Kaushik1216 - comment - 9 Jan 2023

should we wait more for other person to response ? As It is inactive for long time

avatar garkell
garkell - comment - 11 Jan 2023

I tested this from the perspective of including the extension element in the database but there is still the problem of the tags being set as an array when an array is passed as a parameter, or am I missing something? If I use the existing code with this change included the tags passed as an array and then encased as an array so I think Line 401 should be changed from
$params->tags = array($tags);
to
$params->tags = $tags;
Apologies if I've missed something due to my inexperience. Cheers.

avatar ReLater
ReLater - comment - 11 Jan 2023

@garkell
I don't disagree, I'm just irritated. In the docBlock I see:

@param array $tags Associative array of tags to replace

In your example code on #39480 (comment)

you pass over array("name","sitename","link_text") which isn't an ASSOCIATIVE(!) array as far as I know. So, the DocBlock must be corrected, too? When I look into the database it looks like that.

avatar ReLater
ReLater - comment - 11 Jan 2023

@Kaushik1216

should we wait more for other person to response ? As It is inactive for long time

You don't have to wait and can prepare your pr for tests but you should be aware that if @rigin continues his pr any time soon (we should understand that some people on earth have more serious problems at the moment) that yours will be closed.

avatar joomla-cms-bot joomla-cms-bot - change - 8 Feb 2023
Category Libraries Administration Language & Strings Libraries
avatar joomla-cms-bot joomla-cms-bot - change - 8 Feb 2023
Category Libraries Administration Language & Strings Libraries
avatar Kaushik1216 Kaushik1216 - change - 8 Feb 2023
Labels Added: Language Change
avatar ReLater
ReLater - comment - 12 Feb 2023

@Kaushik1216
I think, after one month of waiting you can continue here if you still want to.

But be aware that I'm only a contributor like you. I have nothing to decide here ;-)

avatar Kaushik1216 Kaushik1216 - change - 13 Feb 2023
Labels Removed: Language Change
avatar Kaushik1216
Kaushik1216 - comment - 13 Feb 2023

@ReLater Can U please test this PR I have remove extra parmeter .Thank in advance

avatar Kaushik1216 Kaushik1216 - change - 11 Mar 2023
Labels Added: ?
avatar Kaushik1216
Kaushik1216 - comment - 11 Mar 2023

@Quy @Fedik Please test it

avatar Fedik
Fedik - comment - 12 Mar 2023

It almost works.

Please also fix the Tags, change this:

$params->tags          = [$tags];

to

$params->tags          = (array) $tags;

In both createTemplate and updateTemplate methods.

avatar Kaushik1216
Kaushik1216 - comment - 12 Mar 2023

It almost works.

Please also fix the Tags, change this:

$params->tags          = [$tags];

to

$params->tags          = (array) $tags;

In both createTemplate and updateTemplate methods.

done

avatar Fedik Fedik - test_item - 12 Mar 2023 - Tested successfully
avatar Fedik
Fedik - comment - 12 Mar 2023

I have tested this item successfully on 6565c85


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

avatar viocassel viocassel - test_item - 14 Mar 2023 - Tested successfully
avatar viocassel
viocassel - comment - 14 Mar 2023

I have tested this item successfully on 6565c85


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

avatar alikon alikon - change - 14 Mar 2023
Status Pending Ready to Commit
avatar alikon
alikon - comment - 14 Mar 2023

RTC


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

avatar Kaushik1216
Kaushik1216 - comment - 25 Mar 2023

Please Merge this PR !

avatar chmst
chmst - comment - 25 Mar 2023

@Kaushik1216 Congrats for your PR set to RTC :)
Please be patient - release managers decide when a PR can be merged, following their version planning.

avatar HLeithner
HLeithner - comment - 2 May 2023

This pull request has been automatically rebased to 4.3-dev.

avatar obuisard obuisard - change - 6 May 2023
Labels Added: ? bug
avatar obuisard obuisard - change - 6 May 2023
Labels Added: PR-4.3-dev
avatar obuisard obuisard - change - 6 May 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-05-06 21:51:27
Closed_By obuisard
avatar obuisard obuisard - close - 6 May 2023
avatar obuisard obuisard - merge - 6 May 2023
avatar obuisard
obuisard - comment - 6 May 2023

The fix is in! Thank you @Kaushik1216 for the PR

Add a Comment

Login with GitHub to post a comment