Skip to content

[Snyk] Upgrade i18next from 23.11.5 to 23.12.1#26

Closed
respencer wants to merge 1 commit intomasterfrom
snyk-upgrade-14f27677bce04679b3912c6a61b3b96c
Closed

[Snyk] Upgrade i18next from 23.11.5 to 23.12.1#26
respencer wants to merge 1 commit intomasterfrom
snyk-upgrade-14f27677bce04679b3912c6a61b3b96c

Conversation

@respencer
Copy link
Owner

snyk-top-banner

Snyk has created this PR to upgrade i18next from 23.11.5 to 23.12.1.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 2 versions ahead of your current version.

  • The recommended version was released on 22 days ago.

Release notes
Package name: i18next
  • 23.12.1 - 2024-07-14
    • Use explicit imports for utils 2212
  • 23.12.0 - 2024-07-14
    • feat: Add posibility to override keyPrefix for certain translation. 2211
  • 23.11.5 - 2024-05-20
    • perf: use Array.isArray() 2193
    • perf: trim keys once 2194
from i18next GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade i18next from 23.11.5 to 23.12.1.

See this package in npm:
i18next

See this project in Snyk:
https://app.snyk.io/org/respencer/project/bcafe9f2-0544-4595-877e-01a68c123c9e?utm_source=github&utm_medium=referral&page=upgrade-pr
@github-actions
Copy link

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Sep 20, 2024
@github-actions
Copy link

github-actions bot commented Oct 5, 2024

This PR was closed because it has been stalled for 15 days with no activity.

@github-actions github-actions bot closed this Oct 5, 2024
pull bot pushed a commit that referenced this pull request Oct 19, 2025
…andling (ChurchCRM#7417)

## Problem

Users were encountering unclear errors when attempting to run database
backups from the Admin menu. The error message was cryptic and didn't
indicate the root cause:

```
Error making API Call to: /api/database/backup
Error text: Unable to create backup archive at /volume1/wwwroot/ChurchCRM-3.0.5/tmp_attach/ChurchCRMBackups/...
```

The underlying issue was that when the backup temporary directory
couldn't be created (typically due to permission issues), the `mkdir()`
call would fail silently. The code would continue execution and fail
later when attempting to write backup files to the non-existent
directory, resulting in confusing error messages.

## Solution

Added proper error handling to the `createEmptyTempFolder()` method in
`src/ChurchCRM/Backup/JobBase.php`. The fix:

1. **Checks if directory creation succeeds** - Verifies the return value
of `mkdir()`
2. **Handles edge cases** - Doesn't throw an exception if the directory
already exists
3. **Provides clear error messages** - Includes:
   - The exact path where creation failed
   - The underlying system error message
   - Actionable guidance to check web server permissions
4. **Logs errors appropriately** - Ensures issues are captured for
debugging

### Code Change

```php
// Before: No error checking
mkdir($TempFolder, 0750, true);

// After: Proper error handling
if (!mkdir($TempFolder, 0750, true) && !is_dir($TempFolder)) {
    $error = error_get_last();
    $message = 'Failed to create backup directory at ' . $TempFolder;
    if ($error) {
        $message .= ': ' . $error['message'];
    }
    $message .= '. Please ensure the web server has write permissions to the parent directory.';
    LoggerUtils::getAppLogger()->error($message);
    throw new \Exception($message, 500);
}
```

## Benefits

- **Early failure detection** - Errors are caught immediately when
directory creation fails
- **Clear error messages** - Users get actionable information about what
went wrong and how to fix it
- **Better debugging** - Errors are properly logged for system
administrators
- **Broader impact** - Fixes both backup AND restore operations since
both inherit from `JobBase`

## Testing

- Verified logic with multiple test scenarios (normal operation,
existing directory, permission denied)
- PHP syntax validation passed
- No breaking changes or side effects

Fixes #8846 (referenced in the issue comments about permission-related
backup failures)

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>


----

*This section details on the original issue you should resolve*

<issue_title>Failed to Run Backup Database</issue_title>
<issue_description>Hi,
Encounter error when run Backup Database from the Admin menu.
The directory and file has permission 755 & 744 receptively.

Following is the error reported.

Error making API Call to: /api/database/backup

Error text: Unable to create backup archive at
/volume1/wwwroot/ChurchCRM-3.0.5/tmp_attach/ChurchCRMBackups/SIBKLChineseChurch-Database.sql]

```
[
  "#0 /volume1/wwwroot/ChurchCRM-3.0.5/api/routes/system/system-database.php(31): ChurchCRM\\Service\\SystemService->getDatabaseBackup(Object(stdClass))",
  "#1 [internal function]: Closure->{closure}(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Array)",
  "#2 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Object(Closure), Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Array)",
  "#3 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/Route.php(335): Slim\\Handlers\\Strategies\\RequestResponse->__invoke(Object(Closure), Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Array)",
  "#4 /volume1/wwwroot/ChurchCRM-3.0.5/ChurchCRM/Slim/Middleware/Role/BaseAuthRoleMiddleware.php(27): Slim\\Route->__invoke(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#5 [internal function]: ChurchCRM\\Slim\\Middleware\\Role\\BaseAuthRoleMiddleware->__invoke(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Slim\\Route))",
  "#6 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(ChurchCRM\\Slim\\Middleware\\Role\\AdminRoleAuthMiddleware), Array)",
  "#7 [internal function]: Slim\\DeferredCallable->__invoke(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Slim\\Route))",
  "#8 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\\DeferredCallable), Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Slim\\Route))",
  "#9 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\\Route->Slim\\{closure}(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#10 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/Route.php(313): Slim\\Route->callMiddlewareStack(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#11 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/App.php(495): Slim\\Route->run(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#12 /volume1/wwwroot/ChurchCRM-3.0.5/ChurchCRM/Slim/Middleware/VersionMiddleware.php(13): Slim\\App->__invoke(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#13 [internal function]: ChurchCRM\\Slim\\Middleware\\VersionMiddleware->__invoke(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Slim\\App))",
  "#14 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(ChurchCRM\\Slim\\Middleware\\VersionMiddleware), Array)",
  "#15 [internal function]: Slim\\DeferredCallable->__invoke(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Slim\\App))",
  "#16 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\\DeferredCallable), Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Slim\\App))",
  "#17 /volume1/wwwroot/ChurchCRM-3.0.5/ChurchCRM/Slim/Middleware/AuthMiddleware.php(42): Slim\\App->Slim\\{closure}(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#18 [internal function]: ChurchCRM\\Slim\\Middleware\\AuthMiddleware->__invoke(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Closure))",
  "#19 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(ChurchCRM\\Slim\\Middleware\\AuthMiddleware), Array)",
  "#20 [internal function]: Slim\\DeferredCallable->__invoke(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Closure))",
  "#21 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\\DeferredCallable), Object(Slim\\Http\\Request), Object(Slim\\Http\\Response), Object(Closure))",
  "#22 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\\App->Slim\\{closure}(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#23 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/App.php(388): Slim\\App->callMiddlewareStack(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#24 /volume1/wwwroot/ChurchCRM-3.0.5/vendor/slim/slim/Slim/App.php(296): Slim\\App->process(Object(Slim\\Http\\Request), Object(Slim\\Http\\Response))",
  "#25 /volume1/wwwroot/ChurchCRM-3.0.5/api/index.php(75): Slim\\App->run()",
  "#26 {main}"
]
```
...

</details>

Fixes ChurchCRM#4300

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start
the survey.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants