Custom Attribute using Date

Permalink
Hi
I have set up a custom attribute to use in Composer and have set this as a Date attribute. It works fine in the composer, but when I try to add it on the Page Template the problems start.

The first thing is the Attribute doesnt show on the page while still in edit mode. Then when it is saved it throws an 'Unexpected error' message stating
Can't convert '[Date Completed]' to a \DateTime
I am unable to delete the attribute from the page as it isnt visible. All other custom attributes are unaffected and ok.

I have attached a screen shot to show the problem.

Thanks Simon.

1 Attachment

dclmedia
 
andrew replied on at Permalink Reply
andrew
When you say add it to the page template what do you mean? You mean using the page properties block on the page itself throws that error?
dclmedia replied on at Permalink Reply 1 Attachment
dclmedia
I am expanding on the Elemental theme for displaying a portfolio and created a page attribute called date_completed. i've attached an image of the attribute setup
hutman replied on at Permalink Reply
hutman
The attached image does not show enough information to be helpful. Where do you get this error; front end page display, front end attribute editing screen or Dashboard under Page Attributes?
dclmedia replied on at Permalink Reply 6 Attachments
dclmedia
I am getting this error when I go to configure the Output of the Page Type from the Page Types dashboard page.

I have attached 6 screen full shots showing the different elements associated with the problem, hopefully this will help...

Thanks :-)
hutman replied on at Permalink Reply
hutman
If you add a page of this type to your site and set that variable, do you get that error? I am guessing that the Page Type Defaults is choking on it because the variable is not set but it expects it to be
dclmedia replied on at Permalink Reply
dclmedia
Interesting hutman!
I created a page and set the variable as you suggested and it displays is ok, so it would seem it is choking as you have suggested. The problem with this is that I cannot configure the output for the rest of the Page Type.
hutman replied on at Permalink Best Answer Reply
hutman
I think if you click the Attributes button in the Dashboard for that page type, where it lists out all of the attributes, if you click on the greyed out "none" you can set a default, which will cause that page to work properly again. I haven't tried this but it stands to reason that should work.
dclmedia replied on at Permalink Reply
dclmedia
That has sorted it, thanks!

Is this a minor 'bug' that needs resolving?
hutman replied on at Permalink Reply
hutman
The same thing happened in 5.6 too, so I'm not sure if they would consider it a bug or not. Possibly since adding attribute output to pages is so much easier this way now.
lota replied on at Permalink Reply 1 Attachment
lota
Hi all,
I get the same strange error when I try to apply a CustomTemplate on a PageListBlock on a Multilingual site.

The same operations produce error if I edit a page in Italian section.

All works fine on English section.

Could be a core issue or a specific theme issue?

I use 5.7.5.6 and Multilingual from System & Settings.

TIA
Alessandro