More in this section

Forums / Developing with Sitefinity / Publication_Date in Libraries

Publication_Date in Libraries

7 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    20 Jul 2010
    Link to this post
    Hi all,

    I've created a new metafield inside a custom library, called: Publication_Date. According to the manual this is NOT a default field for Libraries.

    <add key="Media.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/>

    I added this field also to the metafield collection of the Custom Library:

    <add name="Custom" title="Custom Library" defaultExtenstions=".*" metaKeys="Name, Width, Height, Size, Extension, AlternateText, Author, Description, Category, PermaLink, Verse, Speaker, Publication_Date"></add

    I've edited the LibraryItemEdit.ascx and added the field:

    <li>
       <asp:Label ID="Label6" AssociatedControlID="Publication_Date" runat="server">
       <asp:Literal ID="Literal28" runat="server" Text="<%$Resources:ItemEdit_PublicationDate %>"></asp:Literal>
       <em id="Publication_DateLabel" runat="server"></em></asp:Label>
       <telerik:RadDateTimePicker ID="Publication_Date" runat="server">
       </telerik:RadDateTimePicker>
    </li>

    Then I edited the LibraryItemBatchEdit.ascx and added the field:

    <li>
       <asp:Label ID="Label4" AssociatedControlID="Publication_Date" runat="server">
       <asp:Literal ID="Literal2" runat="server" Text="<%$Resources:BatchEdit_PublicationDate %>"></asp:Literal>
       <em id="Publication_DateLabel" runat="server"></em></asp:Label>
       <telerik:RadDateTimePicker ID="Publication_Date" runat="server">
       </telerik:RadDateTimePicker>
    </li>

    Now when I upload an item and then again edit the item, all is okay. When I batch edit the item(s) the Publication_Date is set to the default date, so it is not doing anything with it, resulting in some errors on my webpage, because it is 'default', or empty.

    I don't know what I'm doing wrong here. It goes well with other custom fields I've added?

    -Daniel-
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jul 2010
    Link to this post
    Hi Daniel,

    Check whether you have added the RadDateTimePicker inside ContentMetaFields control declaration of LibraryItemBatchEdit template. Inside the template there are two controls of type ContentMetaFields  - the first one is with ID="Images" - it saves the data for images and the second one is with ID="Default" - it saves the data for all other type of files. For DateTime you can use the following types of controls RadDateInput
    RadDatePicker, ITextControl

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    20 Jul 2010
    Link to this post
    Hi Ivan,

    The RadDateTimePicker is inside the ContentMetaFields section with ID 'Default'.
    The strange thing is that the first time you do a batch edit, it looks like the values are stored correctly.
    The second time not.

    The default value for this field is the current DateTime (#Now). This is the value that is inserted...
    Is it possible that the RadDateTimePicker sent it's Text value to the database, instead of the DbSelectedDate?
    Well, probably you guys took care of that, but it's just an idea.

    So, unfortunate it doesn't work.

    Regards,
    Daniel
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jul 2010
    Link to this post
    Hi Daniel,

    This is a bug in our code. The issue has been fixed and you have to upgrade your project to the next SP.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    20 Jul 2010
    Link to this post
    I work on SP3. Is there a newer SP?

    Regards,
    Daniel
  6. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    20 Jul 2010
    Link to this post
    How about that, I just got a call from a client today that I built a site for. It's been in production for a few months now and they just attempted to batch update a number of files (100+) and just lost all their PublishedDate meta data!!! Doh!!

    I'm sure Telerik is heads down busy with SF4, so I'd be really surprised if there's a SP anywhere close to complete. So how about a hotfix instead? It's the difference between me being a hero or mud in my clients eyes.

    Fingers crossed for a quick fix!!

    Cheers,,
    Phill
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jul 2010
    Link to this post
    Hi Phill Hodgkinson,

    There is no quick fix for this issue. The fix will come with the next SP ( SP4) as I wrote in my previous post. The SP will be available after we release Sitefinity 4 BETA which is after the middle of August.
    I can send you a custom build with the fix upon a support request, but it has not been approved by our QA so I cannot guarantee for any other issue ( but I do not believe that there will be).

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered