Skip to content

Commit 55bb034

Browse files
Merge branch 'krayin:2.1' into script/workflow
2 parents dddcc6e + 0f42f15 commit 55bb034

File tree

8 files changed

+87
-59
lines changed

8 files changed

+87
-59
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## **v2.1.4 (16 of Sep 2025)** - *Release*
2+
3+
* #2355[fixed] Improved database setup compatibility—now supports longer table prefixes during installation.
4+
5+
* #2328[fixed] Enhanced IMAP integration to ensure all incoming emails are reliably received.
6+
17
## **v2.1.3 (02 of Sep 2025)** - *Release*
28

39
* #2236[fixed] Save button now responsive when linking email to lead during lead creation.

composer.lock

Lines changed: 35 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/Webkul/Activity/src/Database/Migrations/2025_01_17_151632_alter_activities_table.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ public function up()
3030
public function down()
3131
{
3232
Schema::table('activities', function (Blueprint $table) {
33+
$tablePrefix = DB::getTablePrefix();
34+
3335
// Disable foreign key checks temporarily.
3436
DB::statement('SET FOREIGN_KEY_CHECKS=0');
3537

3638
// Drop the foreign key constraint using raw SQL.
37-
DB::statement('ALTER TABLE activities DROP FOREIGN KEY activities_user_id_foreign');
39+
DB::statement('ALTER TABLE '.$tablePrefix.'activities DROP FOREIGN KEY activities_user_id_foreign');
3840

3941
// Drop the index.
40-
DB::statement('ALTER TABLE activities DROP INDEX activities_user_id_foreign');
42+
DB::statement('ALTER TABLE '.$tablePrefix.'activities DROP INDEX activities_user_id_foreign');
4143

4244
// Change the column to be non-nullable.
4345
$table->unsignedInteger('user_id')->nullable(false)->change();

packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,10 @@
21972197
'description' => 'Oops! The page you\'re looking for is on vacation. It seems we couldn\'t find what you were searching for.',
21982198
'title' => '404 Page Not Found',
21992199
],
2200-
'401' => 'Você não tem autorização para acessar esta página',
2200+
'401' => [
2201+
'description' => 'Ops! Parece que você não tem permissão para acessar esta página. Parece que estão faltando as credenciais necessárias.',
2202+
'title' => '401 Não autorizado.',
2203+
],
22012204
'403' => [
22022205
'description' => 'Oops! This page is off-limits. It appears you don\'t have the required permissions to view this content.',
22032206
'title' => '403 Forbidden',

packages/Webkul/Admin/tests/e2e-pw/tests/lang/lang.spec.ts

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { expect, test } from '@playwright/test';
2+
import { execSync } from 'child_process';
13
import fs from 'fs';
24
import path from 'path';
35
import { fileURLToPath } from 'url';
4-
import { test, expect } from '@playwright/test';
56

67
// Resolve file paths relative to this test file
78
const __filename = fileURLToPath(import.meta.url);
@@ -17,24 +18,22 @@ const BASE_LANG = 'en';
1718

1819
// Helper to extract just the keys from app.php
1920
function getNormalizedKeys(filePath: string): string[] {
20-
const raw = fs.readFileSync(filePath, 'utf-8');
21+
// PHP one-liner to output the array as JSON
22+
const phpCode = `echo json_encode(include '${filePath}');`;
23+
const json = execSync(`php -r "${phpCode.replace(/"/g, '\\"')}"`).toString();
24+
const obj = JSON.parse(json);
2125

22-
const clean = raw
23-
.replace(/<\?php\s*/g, '')
24-
.replace(/return\s*\[/, '')
25-
.replace(/\];/, '')
26-
.trim();
26+
function flattenKeys(obj: any, prefix = ''): string[] {
27+
return Object.keys(obj).flatMap(key => {
28+
const fullKey = prefix ? `${prefix}.${key}` : key;
29+
if (typeof obj[key] === 'object' && obj[key] !== null) {
30+
return flattenKeys(obj[key], fullKey);
31+
}
32+
return [fullKey];
33+
});
34+
}
2735

28-
return clean
29-
.split('\n')
30-
.map(line => line.trim())
31-
.filter(line => line.includes('=>') && !line.startsWith('//'))
32-
.map(line => {
33-
// Extract the key before =>
34-
const match = line.match(/^['"](.+?)['"]\s*=>/);
35-
return match ? match[1] : null;
36-
})
37-
.filter(Boolean) as string[];
36+
return flattenKeys(obj);
3837
}
3938
test('All language files must match number of keys and key names with English app.php', () => {
4039
const baseFile = path.join(LANG_DIR, BASE_LANG, 'app.php');

packages/Webkul/Attribute/src/Database/Migrations/2025_07_02_191710_alter_attribute_values_table.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public function up(): void
1616
$table->string('unique_id')->nullable();
1717
});
1818

19-
DB::statement("UPDATE attribute_values SET unique_id = CONCAT(entity_id, '|', attribute_id)");
19+
$tablePrefix = DB::getTablePrefix();
20+
21+
DB::statement('UPDATE '.$tablePrefix."attribute_values SET unique_id = CONCAT(entity_id, '|', attribute_id)");
2022

2123
Schema::table('attribute_values', function (Blueprint $table) {
2224
$table->unique('unique_id');

packages/Webkul/Core/src/Core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Core
1414
*
1515
* @var string
1616
*/
17-
const KRAYIN_VERSION = '2.1.3';
17+
const KRAYIN_VERSION = '2.1.4';
1818

1919
/**
2020
* Create a new instance.

packages/Webkul/Installer/src/Console/Commands/Installer.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function handle()
161161
}
162162

163163
/**
164-
* Checking .env file and if not found then create .env file.
164+
* Checking .env file and if not found then create .env file
165165
*
166166
* @return ?array
167167
*/
@@ -273,7 +273,23 @@ protected function askForDatabaseDetails()
273273
'DB_PREFIX' => text(
274274
label: 'Please enter the database prefix',
275275
default: env('DB_PREFIX', ''),
276-
hint: 'or press enter to continue'
276+
hint: 'or press enter to continue',
277+
validate: function ($value) {
278+
$input = strlen($value);
279+
280+
if ($input
281+
&& ($input < 1
282+
|| $input > 6)
283+
) {
284+
return 'The database prefix must be between 1 and 6 characters.';
285+
}
286+
287+
if (preg_match('/[^a-zA-Z0-9_]/', $value)) {
288+
return 'The database prefix may only contain letters, numbers, and underscores.';
289+
}
290+
291+
return null;
292+
}
277293
),
278294

279295
'DB_USERNAME' => text(

0 commit comments

Comments
 (0)