Developer forum

Forum » Development » ModuleAttachmentRestrictionRule

ModuleAttachmentRestrictionRule

Peter Terkildsen
Reply

Hi,

I'm creating items via code-first, and having some difficulties. My code actually creates the item and I can see it both in the Management Center and in the XML-file. However, the corresponding table in the database is not created until I manually save the item in Management Center. 

I can see that when I save it adds the following missing line to the XML-file:

<rule name="" type="Dynamicweb.Content.Items.Activation.ModuleAttachmentRestrictionRule, Dynamicweb" value="Nothing" />

I've tried adding this via the code, but I simply cannot find the attribute - I've looked everywhere at this forum, but I cannot seem to find anything resembling this attribute. So my code looks like this right now:

    [Item("Tag", "Tags"),Category("Intranet")]
    [AreaRule, StructureRule(StructureContextType.Paragraphs), ParentRule(ParentRestrictionRule.ParentType.RootOfWebsite, ParentRestrictionRule.ParentType.RegularPage)]
    [CustomizedURLs]
    public class Tag : ItemEntry
    {
        [Field("Tag name", typeof(Dynamicweb.Content.Items.Editors.TextEditor))]
        public string TagName { get; set; }
    }

Am I missing something in the list of attributes?

Regards, Peter


Replies

 
Vladimir
Reply

Hi Peter,

Say please what version of Dynamicweb do you use? 

Just made test on DW8.6 - table was created fine (I used your code)

ModuleAttachmentRestrictionRule and other attributes don't affects on this.

(but you can add this attribute(and any other) with:  [RuleAttributeBase(typeof(ModuleAttachmentRestrictionRule), "True")])

 

Best regards,

Vladimir

 

 
Peter Terkildsen
Reply

Hi Vladimir,

The version is Dynamicweb 8.6.0.3.

Peter

 
Vladimir
Reply

Hi Peter,

Retested 8.6.0.3 version, also don't notice any error...

As I think this situation could be possible only if there are errors during synchronization - but you should see notice about that in Item types form (Management canter -> Item types)

Or check please a log in file manager: System/Log/Items/ActivationWorkflow

Best regards,

Vladimir

 

 
Peter Terkildsen
Reply

Hi Vladimir,

Ok, this is very weird. Maybe it's just my development solution that is messed up :-)

However, I just tried finding the log file. There's no log files in System/Log/Items/ActivationWorkflow. Is this because there is nothing to report on, or?

Regards,

Peter

 
Vladimir
Reply

Hi Peter,

yes, usually this means that no errors...

bad... this greatly complicates the diagnosis!

 

Best regards,

Vladimir

 

 

 
Peter Terkildsen
Reply

Ok, I'll try moving the code to another solution and see whether that works. Thanks :-)

Peter

 
Adrian Ursu
Reply

I am experiencing the same problem on version 8.5.1.25.

Anybody managed to find out what caused that error?

I cannot upgrade yet to 8.6

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

What does your log say?

Will it register the item when you go to Items and click refresh?

Does your SQL user have DDL permissions`?

 
Adrian Ursu
Reply

SQL has DDL permissions. I can create Items correctly.

This one I have moved from another solution.

I took the xml file of the Item (like I usually did with other solutions), put it in System/Items

It shows in the back-end (in the Items list. But when I try to save it it returns the Alert about the log in System/Log/Items/ActivationWorkflow.

And I cannot find anything in that location. Actually, I don't even have an Item folder in System/Log. Should I manually create that folder first?

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

This thread is about code first.

Are you just copying an item type definition XML file? And from what version is that file coming from? Can you attach the XML file?

BR Nicolai

 

You must be logged in to post in the forum