Skip to content

[BUG]: text_alignment ignored when collage.allow_selection is disabled #1433

@paaaaaaul0101

Description

@paaaaaaul0101

Describe the bug

When collage.allow_selection is disabled, text_alignment in a layout JSON is not applied. The text stays at the admin default position instead of the JSON-defined zone.

Actual behavior:
text_alignment is ignored unless collage.allow_selection = true.

Steps to reproduce the behavior

  1. Disable “Allow collage selection” in the admin UI (collage.allow_selection = false)
  2. Use a layout JSON that contains a text_alignment block
  3. Create a collage

Expected behavior

text_alignment from the layout JSON should still be applied as long as text-on-collage is enabled.

Photobooth Version

4.99

Browser and browser version

No response

Operating System

No response

Did it work before?

Yes

Latest working version

idk

Additional context

Proposed Fix:
Apply text_alignment whenever text-on-collage is enabled, independent of collage.allow_selection.
Keep text_disabled optionally tied to allow_selection if you want to preserve current behavior.
Line 275 Collage.php

-                    if ($c->collageAllowSelection) {
-                        // JSON layout can only disable or customize text if admin has enabled it
-                        if ($adminTextOnCollageEnabled === 'enabled') {
-                            if (isset($collageJson['text_disabled']) && $collageJson['text_disabled'] === true) {
-                                $c->textOnCollageEnabled = 'disabled';
-                            } elseif (isset($collageJson['text_alignment']) && is_array($collageJson['text_alignment'])) {
-                                $ta = $collageJson['text_alignment'];
-                                $c->textOnCollageEnabled = 'enabled';
+                    // JSON layout can only disable or customize text if admin has enabled it
+                    if ($adminTextOnCollageEnabled === 'enabled') {
+                        if ($c->collageAllowSelection && isset($collageJson['text_disabled']) && $collageJson['text_disabled'] === true) {
+                            $c->textOnCollageEnabled = 'disabled';
+                        } elseif (isset($collageJson['text_alignment']) && is_array($collageJson['text_alignment'])) {
+                            $ta = $collageJson['text_alignment'];
+                            $c->textOnCollageEnabled = 'enabled';

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions