Open axelferdinand opened 10 months ago
Is 4.42.1 also broken?
Yes, tried that specific version now, and the same error is thrown.
Ok I've updated your description then. I think this is caused by https://github.com/statamic/cms/pull/9198
You have some bard field that has a value starting with <p>Virke har f
... (I know that may be hard to find)
Can you provide the blueprint field yaml for that?
Here you go:
title: Event
sections:
main:
display: Main
fields:
-
handle: title
field:
type: text
required: true
display: Title
localizable: true
listable: hidden
input_type: text
antlers: false
validate:
- required
-
handle: lead
field:
type: text
display: Lead
localizable: true
-
handle: img_featured
field:
type: assets
display: 'Featured image'
container: main
folder: img
max_files: 1
listable: hidden
mode: grid
restrict: false
allow_uploads: true
-
import: intro
-
import: modules
sidebar:
display: Sidebar
fields:
-
handle: slug
field:
type: slug
localizable: true
validate:
- required
-
handle: event_style
field:
options:
default: Default
featured: Featured
conference: Conference
inline: false
cast_booleans: false
display: 'Event style'
type: radio
icon: radio
listable: hidden
instructions_position: above
visibility: visible
always_save: false
default: default
-
handle: toc
field:
default: false
display: 'Table of contents'
type: toggle
icon: toggle
instructions: 'Display anchor navigation based on sections.'
listable: hidden
instructions_position: above
visibility: visible
always_save: false
if:
event_style: 'equals conference'
-
handle: toc_title
field:
input_type: text
antlers: false
display: 'Sticky nav title'
type: text
icon: text
listable: hidden
instructions_position: above
visibility: visible
always_save: false
if:
toc: 'equals true'
event_style: 'equals conference'
-
handle: toc_location
field:
input_type: text
antlers: false
display: 'Sticky nav location'
type: text
icon: text
listable: hidden
instructions_position: above
visibility: visible
always_save: false
if:
toc: 'equals true'
event_style: 'equals conference'
-
handle: anchor_box
field:
default: false
display: 'Anchor box'
type: toggle
icon: toggle
listable: hidden
instructions_position: above
visibility: visible
always_save: false
instructions: 'When true, a box with menu items will be shown before the sticky navigation.'
if:
toc: 'equals true'
event_style: 'equals conference'
-
handle: disciplines
field:
type: terms
taxonomies:
- disciplines
display: Disciplines
mode: select
instructions_position: above
listable: hidden
visibility: visible
create: true
always_save: false
-
handle: events
field:
type: terms
taxonomies:
- events
display: Category
mode: select
listable: hidden
create: true
instructions_position: above
visibility: visible
max_items: 1
always_save: false
-
handle: date
field:
type: date
required: true
mode: single
time_enabled: false
time_seconds_enabled: false
full_width: false
inline: false
columns: 1
rows: 1
display: Date
icon: date
listable: hidden
instructions_position: above
visibility: visible
validate:
- required
-
handle: time_from
field:
seconds_enabled: false
display: 'Time from'
type: time
icon: time
width: 50
listable: hidden
instructions_position: above
visibility: visible
-
handle: time_to
field:
seconds_enabled: false
display: 'Time to'
type: time
icon: time
width: 50
listable: hidden
instructions_position: above
visibility: visible
-
handle: last_day
field:
mode: single
time_enabled: false
time_seconds_enabled: false
full_width: false
inline: false
columns: 1
rows: 1
display: 'Last day'
type: date
icon: date
instructions: 'If event spans over multiple days.'
listable: hidden
instructions_position: above
visibility: visible
-
handle: note
field:
input_type: text
antlers: false
display: Note
type: text
icon: text
listable: hidden
instructions_position: above
visibility: visible
-
handle: address
field:
input_type: text
antlers: false
display: Address
type: text
icon: text
listable: hidden
instructions_position: above
visibility: visible
-
handle: alternative
field:
collapse: false
always_show_set_button: false
previews: true
buttons:
- h2
- h3
- bold
- italic
- unorderedlist
- orderedlist
- removeformat
- quote
- anchor
- image
- table
save_html: false
toolbar_mode: fixed
link_noopener: false
link_noreferrer: false
target_blank: false
reading_time: false
fullscreen: true
allow_source: true
enable_input_rules: true
enable_paste_rules: true
antlers: false
remove_empty_nodes: false
display: Alternative
type: bard
icon: bard
listable: hidden
instructions_position: above
visibility: visible
always_save: false
-
handle: price
field:
display: Price
type: integer
icon: integer
listable: hidden
instructions_position: above
visibility: visible
-
handle: price_member
field:
display: 'Price member'
type: integer
icon: integer
listable: hidden
instructions_position: above
visibility: visible
-
handle: instructor
field:
mode: default
create: true
collections:
- people
- externals
display: Instructor(s)
type: entries
icon: entries
listable: hidden
instructions_position: above
visibility: visible
-
handle: instructor_bio
field:
default: false
display: 'Instructor bio'
type: toggle
icon: toggle
width: 50
listable: hidden
instructions_position: above
visibility: visible
always_save: false
-
handle: instructor_contact
field:
default: false
display: 'Instructor contact'
type: toggle
icon: toggle
width: 50
listable: hidden
instructions_position: above
visibility: visible
-
handle: unlisted
field:
default: false
display: 'Stop future signups'
type: toggle
icon: toggle
listable: hidden
instructions_position: above
visibility: visible
always_save: false
-
handle: summary_title
field:
input_type: text
antlers: false
display: 'Summary title (optional)'
type: text
icon: text
listable: hidden
instructions_position: above
visibility: visible
always_save: false
I tried resaving my event posts, but that didn't remove the error.
Hmm no, I mean the field for that specific bard field. I think it's probably inside modules
.
You can use the php please support:zip-blueprint {blueprint}
command to include all the fieldsets.
How do I use the command properly?
Okay so can you share the modules
field definition?
This?
title: Modules
fields:
-
handle: Modules
field:
display: Modules
type: section
icon: section
listable: hidden
-
handle: modules
field:
type: bard
allow_internal_links: true
display: Content
semantic_elements: true
container: main
buttons:
- h1
- h2
- h3
- h4
- bold
- italic
- underline
- strikethrough
- removeformat
- unorderedlist
- orderedlist
- quote
- title
- subtitle1
- lead
- small
- anchor
- code
localizable: true
sets:
main:
display: Main
instructions: null
icon: null
sets:
accordion:
display: Accordion
instructions: 'Collapse content in an accordion.'
icon: null
fields:
-
import: module-header
-
import: accordion
-
import: module-settings
box:
display: Box
instructions: 'Place content inside a box.'
icon: null
fields:
-
import: module-header
-
import: box
-
import: module-settings
brands:
display: Brands
instructions: 'Display up to 100 logos.'
icon: null
fields:
-
import: module-header
-
import: brands
-
import: module-settings
button:
display: Button
instructions: 'Add one or more buttons.'
icon: null
fields:
-
import: module-header
-
import: button
-
import: module-settings
callout:
display: Callout
instructions: 'Highlight content.'
icon: null
fields:
-
import: callout
-
import: module-settings
cards:
display: Cards
instructions: 'Dynamic or static cards with content.'
icon: null
fields:
-
import: module-header
-
import: cards
-
import: module-settings
carousel:
display: Carousel
instructions: 'Add two or more images to a carousel.'
icon: null
fields:
-
import: module-header
-
import: carousel
-
import: module-settings
contactform:
display: 'Contact form'
instructions: 'Display a contact form.'
icon: null
fields:
-
import: module-header
-
import: contactform
-
import: module-settings
contacts:
display: Contacts
instructions: 'Show a selection of contacts.'
icon: null
fields:
-
import: module-header
-
import: contacts
-
import: module-settings
downloads:
display: Downloads
instructions: 'Add downloadable assets.'
icon: null
fields:
-
import: module-header
-
import: downloads
-
import: module-settings
embed:
display: Embed
instructions: 'Embed anything.'
icon: null
fields:
-
import: module-header
-
import: embed
-
import: module-settings
events:
display: Events
instructions: 'List events.'
icon: null
fields:
-
import: module-header
-
import: events
-
import: module-settings
grid:
display: Grid
instructions: 'Organize content in dynamic a grid.'
icon: null
fields:
-
import: module-header
-
import: grid
hints:
display: Hints
instructions: 'List hints.'
icon: null
fields:
-
import: module-header
-
import: hints
-
import: module-settings
icons:
display: Icons
instructions: 'Add icons.'
icon: null
fields:
-
import: module-header
-
import: icons
-
import: module-settings
image:
display: Image
instructions: 'Add image.'
icon: null
fields:
-
import: module-header
-
import: image
-
import: module-settings
map:
display: Map
instructions: 'Display a Google Maps map.'
icon: null
fields:
-
import: module-header
-
import: map
-
import: module-settings
media:
display: Media
instructions: 'Image + text.'
icon: null
fields:
-
import: module-header
-
import: media
-
import: module-settings
module:
display: Module
instructions: 'Insert global module from the modules collection.'
icon: null
fields:
-
import: module-header
-
import: module
-
import: module-settings
newsletter:
display: Newsletter
instructions: 'Insert the newsletter module.'
icon: null
fields:
-
import: newsletter
-
import: module-settings
reports:
display: Reports
instructions: 'List reports.'
icon: null
fields:
-
import: module-header
-
import: reports
-
import: module-settings
timeline:
display: Schecdule
instructions: 'Insert a timeline.'
icon: null
fields:
-
import: module-header
-
import: timeline
-
import: module-settings
section:
display: Section
instructions: 'Divide the page in sections.'
icon: null
fields:
-
import: section
stats:
display: Stats
instructions: null
icon: null
fields:
-
import: module-header
-
import: stats
-
import: module-settings
steps:
display: Steps
instructions: 'Step by step overview'
icon: null
fields:
-
import: module-header
-
import: steps
-
import: module-settings
table:
display: Table
instructions: 'Present content in a table.'
icon: null
fields:
-
import: module-header
-
import: table
-
import: module-settings
tabs:
display: Tabs
instructions: 'Divide content into tabs.'
icon: null
fields:
-
import: module-header
-
import: tabs
-
import: module-settings
text:
display: Text
instructions: 'Just text, plain or not.'
icon: null
fields:
-
import: module-header
-
import: text
-
import: module-settings
title_text:
display: 'Title + Text'
instructions: 'Display a title with text next to it.'
icon: null
fields:
-
import: module-header
-
import: title_text
-
import: module-settings
video:
display: Video
instructions: 'Display a video.'
icon: null
fields:
-
import: module-header
-
import: video
-
import: module-settings
quote:
display: Quote
instructions: 'A quotation or quote.'
icon: null
fields:
-
import: module-header
-
import: quote
-
import: module-settings
listable: hidden
always_show_set_button: false
save_html: false
toolbar_mode: fixed
link_noopener: false
link_noreferrer: false
target_blank: false
reading_time: false
fullscreen: true
allow_source: true
enable_input_rules: true
enable_paste_rules: true
instructions_position: above
antlers: false
visibility: visible
always_save: false
collapse: false
previews: true
remove_empty_nodes: false
smart_typography: false
inline: false
hide_display: false
replicator_preview: true
word_count: false
Yes, thank you.
Is that field the only place where Virke har f
appears in your content files?
Yes, the only place!
I can add another weird finding. In one of my other templates, I have this markup:
{{ get_content from="{url}" scope="contacts" }}
{{ partial:contacts-item }}
{{ partial:modules }}
{{ /get_content }}
If I change get_content
source from {url}
to simply /
or another fixed URL, it works fine.
Any update on this? I'm now 14 versions behind 😅
If you're able to share your site or create a sample repo with this reproduced, we'd be able to fix it faster.
Shared with you just now! joshuablum already got access.
I also have the same error in an upgrade of a site from 3.x to 4.55.0.
For what I can see a Bard field causes this when I'm trying to json_encode it.
In Flare get an argument of $value:Statamic\Fields\Value
with value <p></p>
that when goes to the performAugmentation
of the Bard field it gets into the convertLegacyTiptap
method which somehow doesn't catch it as a string in line 515 but continues on.
I will investigate further and get back to you.
Edit:
It seems like the other values passed to convertLegacyTiptap
are already augmented, but this one is passed a Value
object:
Statamic\Fields\Value#1
(
[*:raw] => '<p></p>'
[*:handle] => 'text'
[*:fieldtype] => Statamic\Fieldtypes\Text#2
(
[*:field] => Statamic\Fields\Field#3
(
[*:handle] => 'text'
[*:prefix] => null
[*:config] => [
'antlers' => false,
]
[*:value] => null
[*:parent] => null
[*:parentField] => null
[*:parentIndex] => null
[*:validationContext] => null
[*:form] => null
)
[*:localizable] => true
[*:validatable] => true
[*:defaultable] => true
[*:selectable] => true
[*:selectableInForms] => true
[*:relationship] => false
[*:categories] => [
0 => 'text',
]
[*:rules] => [],
[*:extraRules] => [],
[*:defaultValue] => null
[*:configFields] => [],
[*:icon] => null
)
[*:augmentable] => null
[*:shallow] => false
)
Edit 2:
If I add
if ($value instanceof \Statamic\Fields\Value) {
$value = $value->value();
}
at the top of the convertLegacyTiptap
method this is fixed and the rest of the json_encode
works (meaning the data gets passed as it used to in v3).
I would PR but I feel this has to be fixed elsewhere.
Any news on this? I now have multiple sites that I can't upgrade until this is fixed – locked on "statamic/cms": "4.42.0"
Any news on this? I now have multiple sites that I can't upgrade until this is fixed – locked on "statamic/cms": "4.42.0"
Sorry, no news yet. We've been focusing on v5 for the last couple of weeks. We'll update this issue when we have an update.
Thank you @duncanmcclean !
Quick update: I've managed to track down the cause of this issue and I've opened a PR to fix it, see #10104.
Thank you 🙏
fre. 17. mai 2024 kl. 19:49 skrev Duncan McClean @.***>:
Quick update: I've managed to track down the cause of this issue and I've opened a PR to fix it, see #10104 https://github.com/statamic/cms/pull/10104.
— Reply to this email directly, view it on GitHub https://github.com/statamic/cms/issues/9352#issuecomment-2117300645, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPZ5RX4AQMTHC65WUNXQE3ZCXOCJAVCNFSM6AAAAABCALKAAGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJXGMYDANRUGU . You are receiving this because you authored the thread.Message ID: @.***>
Re-opening since this still seems to be an issue, see comment on related PR: https://github.com/statamic/cms/pull/10104#issuecomment-2169261934
Can I help somehow with closing this?
As I said in the PR Duncan's fixed worked, the later change from Jason broke it again.
Can I help somehow with closing this?
Sorry for the delay in responding. Are you able to provide access to your site?
Hey Duncan, give me a couple of days to reproduce it and I'll message you with access to a site that this happens.
Bug description
See this thread on Discord: https://discord.com/channels/489818810157891584/1196439151604678756
As reported, as of Statamic version 4.42.1 and upwards, I get this error in most of my templates:
ArrayIterator::__construct(): Argument #1 ($array) must be of type array, string given
I narrowed it down to the following:
In my default template
default.antlers.html
I have the following markup:This works perfectly fine. However, in my other templates, i.e.
events.antlers.html
, I get the error above – despite markup being almost identical:This is the content of
partial:modules
:It's fairly complex, but it does what it should – until Statamic version 4.42.1 arrived...
Removing
{{ partial src="modules/{type}" }}
removes the error, but I have manually gone through every single type of modules, by deleting one by one to see if the error dissapears, but it doesn't.Really weird.
Help?
How to reproduce
Oh, see above 😅
Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
Runtime (default)
Additional details
Nah