Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal: Restoring mail conf variables #5462

Merged
merged 18 commits into from
May 24, 2024
Merged

Conversation

AngelFQC
Copy link
Member

Refs BT#21613

public/main/inc/lib/api.lib.php Show resolved Hide resolved
public/main/inc/lib/api.lib.php Show resolved Hide resolved
public/main/inc/lib/api.lib.php Outdated Show resolved Hide resolved
public/main/inc/lib/api.lib.php Outdated Show resolved Hide resolved
public/main/inc/lib/notification.lib.php Show resolved Hide resolved
@AngelFQC AngelFQC force-pushed the BT21613 branch 2 times, most recently from b3a67d5 to 8183c3b Compare May 6, 2024 16:07
@AngelFQC AngelFQC marked this pull request as ready for review May 6, 2024 18:18
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;

class Version20240506164100 extends AbstractMigrationChamilo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing class doc comment


$this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable, access_url_locked) VALUES ('smtp_from_name', null, null, 'mail', '$selectedMailValue', 'smtp_from_name', null, '', null, 1, 1, 1)");
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected 1 newline at end of file; 0 found

@@ -163,6 +163,21 @@ public function getConfigurationValue($variable, $configuration = null)
return false;
}

public function getMailConfigurationValue(string $variable, array $configuration = []): mixed
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

@@ -163,6 +163,21 @@
return false;
}

public function getMailConfigurationValue(string $variable, array $configuration = []): mixed
{
global $platform_email;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "platform_email" is not in valid camel caps format

global $platform_email;

if ($configuration) {
$platform_email = $configuration;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "platform_email" is not in valid camel caps format


/* For licensing terms, see /license.txt */

declare(strict_types=1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a single space around assignment operators

$platform_email = $configuration;
}

if (isset($platform_email[$variable])) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "platform_email" is not in valid camel caps format

}

if (isset($platform_email[$variable])) {
return $platform_email[$variable];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "platform_email" is not in valid camel caps format

@@ -332,4 +347,28 @@

return $this->entityManager->find(Session::class, $id);
}

public function getMailConfigurationValueFromFile(string $variable): ?string
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment


public function getMailConfigurationValueFromFile(string $variable): ?string
{
global $platform_email;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "platform_email" is not in valid camel caps format

Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 40.22%. Comparing base (cd1b9f9) to head (c10831d).
Report is 11 commits behind head on master.

Current head c10831d differs from pull request most recent head 26cc577

Please upload reports for the commit 26cc577 to get more accurate results.

Files Patch % Lines
...CoreBundle/Migrations/AbstractMigrationChamilo.php 0.00% 17 Missing ⚠️
...e/Migrations/Schema/V200/Version20240506164100.php 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5462      +/-   ##
============================================
+ Coverage     39.78%   40.22%   +0.43%     
+ Complexity    10602    10352     -250     
============================================
  Files           842      823      -19     
  Lines         44320    43573     -747     
============================================
- Hits          17634    17526     -108     
+ Misses        26686    26047     -639     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

AngelFQC and others added 13 commits May 22, 2024 18:32
Also might affect other e-mail sending processes. Was using global platform sender setting before, no matter what.
…fs BT#21613

The text content for mails will be generated from HTML content with league/html-to-markdown
$body,
$senderName,
$senderEmail,
$extra_headers,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "extra_headers" is not in valid camel caps format

$senderName,
$senderEmail,
$extra_headers,
$data_file,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "data_file" is not in valid camel caps format

include_once $oldConfigPath;
}

$settingValue = $this->getConfigurationValue($variable, $platform_email);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "platform_email" is not in valid camel caps format


/* For licensing terms, see /license.txt */

declare(strict_types=1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a single space around assignment operators

use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\BodyRendererInterface;

final class MailHelper
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing class doc comment


final class MailHelper
{
public function __construct(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

final class MailHelper
{
public function __construct(
private readonly MailerInterface $mailer,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 4 spaces, found 8

{
public function __construct(
private readonly MailerInterface $mailer,
private readonly BodyRendererInterface $bodyRenderer,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 4 spaces, found 8

public function __construct(
private readonly MailerInterface $mailer,
private readonly BodyRendererInterface $bodyRenderer,
) {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing brace must be on a line by itself

public function __construct(
private readonly MailerInterface $mailer,
private readonly BodyRendererInterface $bodyRenderer,
) {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing brace must be on a line by itself

Copy link

codeclimate bot commented May 23, 2024

An error occurred when fetching issues.

View more on Code Climate.

@NicoDucou NicoDucou merged commit 119efed into chamilo:master May 24, 2024
2 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants