Okay.. I'm going down the integration path trying to get YAF nicely integrated into a parent project. So far so good.
This is perhaps not a 'bug' but depends on the overall design goals of the project. I'm not sure if a design goal it to allow some yaf controls to be used outside of YAF.
I've taken the EditUsersProfile control and embedded it in a web page. The intent is to allow the user to customize their forum profile, while they are customizing their profile in the parent application. Since the profile is not dependant on the page or forum per say, I assumed it would work.
It almost works, but breaks when it goes to retrieve the UserID. Tracing the code, it flows into the 'Context.cs'.
In "protected void InitUserAndPage()" it breaks at the point of
if ( this.Settings.CategoryID != 0 )
categoryID = this.Settings.CategoryID;
because the this.Settings is null.
Now I'd like to change it to something like the following, so that the Context can still retrieve the UserID without needing the settings, etc.
if ( this.Settings != null ) {
if ( this.Settings.CategoryID != 0 )
categoryID = this.Settings.CategoryID;
}
If I do this, the control loads fine.
But without spending hours understanding the finer details, is this an accetable fix or would it be introducing more problems later?