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

Augmentation not working on markdown fields in navigation #11223

Open
wnschroeder opened this issue Dec 6, 2024 · 3 comments
Open

Augmentation not working on markdown fields in navigation #11223

wnschroeder opened this issue Dec 6, 2024 · 3 comments

Comments

@wnschroeder
Copy link

wnschroeder commented Dec 6, 2024

Bug description

A Markdown field in the navigation is ignored by the augmentation process and passed through to the frontend in Markdown syntax. Even the Markdown modifier does not resolve this issue.

image

image

image

image

How to reproduce

Place a markdown field within a navigation blueprint. In my case it's part of a group fieldtype.

Logs

No response

Environment

Environment
Laravel Version: 11.31.0
PHP Version: 8.3.8
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: localhost:24600
Maintenance Mode: OFF
Timezone: Europe/Berlin
Locale: de

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Livewire
Livewire: v3.5.12

Statamic
Addons: 5
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.40.0 PRO

Statamic Addons
aerni/livewire-forms: 9.4.0
eminos/statamic-tabs: 1.2.0
jonassiewertsen/statamic-livewire: 3.8.1
statamic/seo-pro: 6.3.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@duncanmcclean
Copy link
Member

That's strange - it's working fine for me:

CleanShot 2024-12-06 at 14 33 16
CleanShot 2024-12-06 at 14 34 19
CleanShot 2024-12-06 at 14 33 22

Can you try dumping out the Grid field and the Markdown field to see what it outputs?

{{ depth_1_options | dump }}
{{ depth_1_options:header_section_text | dump }}

@wnschroeder
Copy link
Author

wnschroeder commented Dec 9, 2024

Thank you for the quick response! The behavior I observed has become even less comprehensible to me after the weekend: While my attempts with the markdown modifier were unsuccessful on localhost last week, this morning the text suddenly started being correctly formatted. However, this is only happening on the localhost and not on the server where the site will eventually go live. The data in the field is identical, and all local changes have been deployed to the server.

I dumped the variables in both environments:

Localhost

{{ depth_1_options }}:

array:5 [▼ // vendor/statamic/cms/src/Modifiers/CoreModifiers.php:622
  "header_layout" => 
Statamic\Fields
\
Value {#19418 ▼
    -resolver: null
    #raw: "text"
    #handle: "header_layout"
    #fieldtype: 
Statamic\Fieldtypes
\
Select {#19445 ▶}
    #augmentable: 
Statamic\Entries
\
Entry {#12103 ▶}
    #shallow: false
  }
  "icon_list" => 
Statamic\Fields
\
Value {#20014 ▼
    -resolver: null
    #raw: []
    #handle: "icon_list"
    #fieldtype: 
Statamic\Fieldtypes
\
Replicator {#19447 ▶}
    #augmentable: 
Statamic\Entries
\
Entry {#12103 ▶}
    #shallow: false
  }
  "image_group" => 
Statamic\Fields
\
Value {#16013 ▼
    -resolver: null
    #raw: array:1 [▼
      "header_section_image" => null
    ]
    #handle: "image_group"
    #fieldtype: 
Statamic\Fieldtypes
\
Group {#19478 ▶}
    #augmentable: 
Statamic\Entries
\
Entry {#12103 ▶}
    #shallow: false
  }
  "header_section_text" => 
Statamic\Fields
\
Value {#19481 ▼
    -resolver: null
    #raw: "
**Lorem ipsum dolor sit amet,** consetetur sad pscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna Lorem ipsum dolor sit amet, conset
 ▶
"
    #handle: "header_section_text"
    #fieldtype: 
Statamic\Fieldtypes
\
Markdown {#19472 ▼
      #field: 
Statamic\Fields
\
Field {#19486 ▶}
      #localizable: true
      #validatable: true
      #defaultable: true
      #selectable: true
      #selectableInForms: false
      #relationship: false
      #categories: array:1 [▶]
      #keywords: array:3 [▶]
      #rules: []
      #extraRules: []
      #defaultValue: null
      #configFields: []
      #icon: null
    }
    #augmentable: 
Statamic\Entries
\
Entry {#12103 ▼
      #id: "6f5614e9-2834-4a58-8bf5-98a8318b88f6"
      #collection: "pages"
      #blueprint: "page"
      #date: null
      #locale: "default"
      #afterSaveCallbacks: []
      #withEvents: true
      #template: null
      #layout: null
      -augmentationReferenceKey: "Entry::collections.pages::blueprint|parent|subject_area|template|title|updated_at|updated_by"
      -computedCallbackCache: 
Illuminate\Support
\
Collection {#2665 ▶}
      -siteCache: 
Statamic\Sites
\
Site {#778 ▶}
      #withComputedData: true
      #data: 
Illuminate\Support
\
Collection {#12092 ▼
        #items: array:7 [▼
          "blueprint" => "page"
          "title" => "Schulden bezahlen"
          "parent" => "0dc70199-bf57-4c8e-b46f-f433275d5937"
          "subject_area" => "schulden-bezahlen"
          "template" => "default"
          "updated_by" => "64231806-3799-4c79-b776-87cebf883925"
          "updated_at" => 1731488497
        ]
        #escapeWhenCastingToString: false
      }
      #supplements: 
Illuminate\Support
\
Collection {#12105 ▼
        #items: []
        #escapeWhenCastingToString: false
      }
      #initialPath: "/var/project/src/content/collections/pages/schuldner.md"
      #published: true
      #selectedQueryColumns: null
      #selectedQueryRelations: []
      #original: array:13 [▼
        "collection" => "pages"
        "locale" => "default"
        "origin" => null
        "slug" => "schuldner"
        "date" => null
        "published" => true
        "path" => "/var/project/src/content/collections/pages/schuldner.md"
        "blueprint" => "page"
        "title" => "Schulden bezahlen"
        "parent" => "0dc70199-bf57-4c8e-b46f-f433275d5937"
        "subject_area" => "schulden-bezahlen"
        "template" => "default"
        "updated_by" => "64231806-3799-4c79-b776-87cebf883925"
      ]
      #origin: null
      -cachedKeys: null
      #slug: "schuldner"
    }
    #shallow: false
  }
  "highlight_tile" => 
Statamic\Fields
\
Value {#19474 ▼
    -resolver: null
    #raw: array:5 [▼
      "link" => "entry::dac5b424-37db-4761-9cf5-6ebdd6c0de17"
      "blank" => false
      "linktext" => "Schuldner-Service"
      "text" => "Lorem ipsum dolor sit amet, consetetur sad."
      "icon" => "test_icon"
    ]
    #handle: "highlight_tile"
    #fieldtype: 
Statamic\Fieldtypes
\
Group {#19483 ▶}
    #augmentable: 
Statamic\Entries
\
Entry {#12103 ▶}
    #shallow: false
  }
]

{{ depth_1_options:header_section_text }}:

"
<p><strong>Lorem ipsum dolor sit amet,</strong> consetetur sad pscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna Lorem ipsum dolor sit amet, consetetur sad.</p>
 ◀
" // vendor/statamic/cms/src/Modifiers/CoreModifiers.php:622

Server

{{ depth_1_options }}:

array:5 [▼ // vendor/statamic/cms/src/Modifiers/CoreModifiers.php:622
  "header_layout" => 
Statamic\Fields
\
Value {#11610 ▼
    -resolver: null
    #raw: "text"
    #handle: "header_layout"
    #fieldtype: 
Statamic\Fieldtypes
\
Select {#11618 ▶}
    #augmentable: 
Statamic\Entries
\
Entry {[#2522 ▶](https://new.legial.de/#sf-dump-2147266861-ref22522)}
    #shallow: false
  }
  "icon_list" => 
Statamic\Fields
\
Value {#11631 ▼
    -resolver: null
    #raw: []
    #handle: "icon_list"
    #fieldtype: 
Statamic\Fieldtypes
\
Replicator {#11622 ▶}
    #augmentable: 
Statamic\Entries
\
Entry {[#2522 ▶](https://new.legial.de/#sf-dump-2147266861-ref22522)}
    #shallow: false
  }
  "image_group" => 
Statamic\Fields
\
Value {#11602 ▼
    -resolver: null
    #raw: array:1 [▶]
    #handle: "image_group"
    #fieldtype: 
Statamic\Fieldtypes
\
Group {#11640 ▶}
    #augmentable: 
Statamic\Entries
\
Entry {[#2522 ▶](https://new.legial.de/#sf-dump-2147266861-ref22522)}
    #shallow: false
  }
  "header_section_text" => 
Statamic\Fields
\
Value {#11642 ▼
    -resolver: null
    #raw: "
**Lorem ipsum dolor sit amet, **consetetur sad pscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna Lorem ipsum dolor sit amet, conset
 ▶
"
    #handle: "header_section_text"
    #fieldtype: 
Statamic\Fieldtypes
\
Markdown {#11643 ▼
      #field: 
Statamic\Fields
\
Field {#11644 ▶}
      #localizable: true
      #validatable: true
      #defaultable: true
      #selectable: true
      #selectableInForms: false
      #relationship: false
      #categories: array:1 [▶]
      #keywords: array:3 [▶]
      #rules: []
      #extraRules: []
      #defaultValue: null
      #configFields: []
      #icon: null
    }
    #augmentable: 
Statamic\Entries
\
Entry {[#2522 ▼](https://new.legial.de/#sf-dump-2147266861-ref22522)
      #id: "6f5614e9-2834-4a58-8bf5-98a8318b88f6"
      #collection: "pages"
      #blueprint: "page"
      #date: null
      #locale: "default"
      #afterSaveCallbacks: []
      #withEvents: true
      #template: null
      #layout: null
      -augmentationReferenceKey: "Entry::collections.pages::blueprint|parent|subject_area|template|title|updated_at|updated_by"
      -computedCallbackCache: 
Illuminate\Support
\
Collection {#2862 ▼
        #items: []
        #escapeWhenCastingToString: false
      }
      -siteCache: 
Statamic\Sites
\
Site {#703 ▼
        #handle: "default"
        #config: array:4 [▶]
        #rawConfig: array:4 [▼
          "name" => "{{ config:app:name }}"
          "url" => "{{ config:app:url }}"
          "locale" => "de_DE"
          "lang" => "de_DE"
        ]
      }
      #withComputedData: true
      #data: 
Illuminate\Support
\
Collection {#2546 ▼
        #items: array:7 [▼
          "blueprint" => "page"
          "title" => "Schulden bezahlen"
          "parent" => "0dc70199-bf57-4c8e-b46f-f433275d5937"
          "subject_area" => "schulden-bezahlen"
          "template" => "default"
          "updated_by" => "64231806-3799-4c79-b776-87cebf883925"
          "updated_at" => 1731488497
        ]
        #escapeWhenCastingToString: false
      }
      #supplements: 
Illuminate\Support
\
Collection {#2561 ▼
        #items: []
        #escapeWhenCastingToString: false
      }
      #initialPath: "/var/www/html/legial.de/src/content/collections/pages/schuldner.md"
      #published: true
      #selectedQueryColumns: null
      #selectedQueryRelations: []
      #original: array:13 [▼
        "collection" => "pages"
        "locale" => "default"
        "origin" => null
        "slug" => "schuldner"
        "date" => null
        "published" => true
        "path" => "/var/www/html/legial.de/src/content/collections/pages/schuldner.md"
        "blueprint" => "page"
        "title" => "Schulden bezahlen"
        "parent" => "0dc70199-bf57-4c8e-b46f-f433275d5937"
        "subject_area" => "schulden-bezahlen"
        "template" => "default"
        "updated_by" => "64231806-3799-4c79-b776-87cebf883925"
      ]
      #origin: null
      -cachedKeys: null
      #slug: "schuldner"
    }
    #shallow: false
  }
  "highlight_tile" => 
Statamic\Fields
\
Value {#11646 ▼
    -resolver: null
    #raw: array:5 [▶]
    #handle: "highlight_tile"
    #fieldtype: 
Statamic\Fieldtypes
\
Group {#11647 ▶}
    #augmentable: 
Statamic\Entries
\
Entry {[#2522 ▶](https://new.legial.de/#sf-dump-2147266861-ref22522)}
    #shallow: false
  }
]

{{ depth_1_options:header_section_text }}:

"
<p>**Lorem ipsum dolor sit amet, **consetetur sad pscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna Lorem ipsum dolor sit amet, consetetur sad.</p>
 ◀
" // vendor/statamic/cms/src/Modifiers/CoreModifiers.php:622

@duncanmcclean
Copy link
Member

Just to confirm: both local & your server are running exactly the same code, with the same versions of dependencies?

Can you provide the output of php please support:details on the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants