Page Slugs not being persisted??

Topics: Business Logic Layer
Jul 6, 2009 at 2:07 PM

Am i missing something or are 'Slugs' for pages arent being saved?

The 'be_posts' table has a 'Slug' column, but the 'be_Pages' doesnt.. 

 

Jul 6, 2009 at 2:10 PM

I am experiencing this to - using sql data source!

Jul 6, 2009 at 2:18 PM

yeah, ive just noticed it. They are fine while the app is still in memory as they are stored on the page object, but they are not persisted to the database so as soon as the app reloads, they are gone.

Im working on a fix... So far ive got this...

1. Add the field to the be_pages table

[Slug] [nvarchar](255) NULL,

 

2. Then in the DBLogProvider.cs, update the  following procedures to include the Slug field/parameter.

public override void UpdatePage(Page page);
public override void InsertPage(Page page);
public override Page SelectPage(Guid id); 

 

I think that should do it.. just testing now....

 

 

 

 

 

 

 

Jul 6, 2009 at 2:31 PM

Also need to update the "page.cs"

 

 

public string Slug
{
   get
	{
	   if (string.IsNullOrEmpty(_Slug))
	       return Utils.RemoveIllegalCharacters(Title);
	    return _Slug;
	}
   set 
       {
         if (_Slug != value) MarkChanged("Slug");
             _Slug = value; 
        }

}

 

 

Jul 6, 2009 at 2:31 PM

Yeah i've done exactly the same, seems to work!

Jul 6, 2009 at 3:11 PM

Working for me too... 

Thants another one sorted...

:)