Merge pull request #14737 from MrPetovan/bug/14131-dropzone-error

Account for calendar post edition in editpost()
This commit is contained in:
Tobias Diekershoff 2025-01-27 06:31:10 +01:00 committed by GitHub
commit 73fd2b23a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 64 additions and 57 deletions

View file

@ -147,7 +147,8 @@ class Temporal
}
$tpl = Renderer::getMarkupTemplate("field_input.tpl");
$o = Renderer::replaceMacros($tpl,
$o = Renderer::replaceMacros(
$tpl,
[
'$field' => [
'dob',
@ -157,7 +158,8 @@ class Temporal
'',
'placeholder="' . DI::l10n()->t('YYYY-MM-DD or MM-DD') . '"'
]
]);
]
);
return $o;
}
@ -223,17 +225,19 @@ class Temporal
bool $picktime = true,
string $minfrom = '',
string $maxfrom = '',
bool $required = false): string
{
bool $required = false
): string {
// First day of the week (0 = Sunday)
$firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'calendar', 'first_day_of_week', 0);
$firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'calendar', 'first_day_of_week') ?: 0;
$lang = DI::l10n()->toISO6391(DI::l10n()->getCurrentLang());
// Check if the detected language is supported by the picker
if (!in_array($lang,
if (!in_array(
$lang,
['ar', 'ro', 'id', 'bg', 'fa', 'ru', 'uk', 'en', 'el', 'de', 'nl', 'tr', 'fr', 'es', 'th', 'pl', 'pt', 'ch', 'se', 'kr',
'it', 'da', 'no', 'ja', 'vi', 'sl', 'cs', 'hu'])) {
'it', 'da', 'no', 'ja', 'vi', 'sl', 'cs', 'hu']
)) {
$lang = 'en';
}
@ -351,8 +355,7 @@ class Temporal
// translators - e.g. 22 hours ago, 1 minute ago
if($isfuture) {
$format = DI::l10n()->t('in %1$d %2$s');
}
else {
} else {
$format = DI::l10n()->t('%1$d %2$s ago');
}

View file

@ -270,12 +270,16 @@ function editpost(url) {
// To make dropzone fileupload work on editing a comment, we need to
// attach a new dropzone to modal
if ($('#jot-text-wrap').length > 0) {
dzFactory.setupDropzone('#jot-text-wrap', 'profile-jot-text');
}
modal.show();
$("#jot-popup").show();
if ($("#profile-jot-text").length > 0) {
linkPreview = $("#profile-jot-text").linkPreview();
}
}
});
}