YAFLogo

kheiser
  • kheiser
  • 72.4% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
6 months ago
This issue also related to search, but it's different from the issues in the other thread.  I think this might also be related to the forum pages being in the /Forums route but the controllers being in the root of the application.  Basically, I'm seeing any link generated in a controller have the route of the controller appended to the start instead of /Forums, and the rest of the link not being properly resolved.  

For example the link to the post in search should be 

/forums/Posts/PostName

but instead it's coming showing up as 

/Search/GetSearchResults?t=48&name=PostName&page=/Posts

Quick reply has a similar issue.

The link is coming from YAFNET.Core\Services\LinkBuilder.cs from the GetLink() method.  I'm not totally sure how this function works, or why it's different when being called from a controller.  Links for regular pages seem to be working fine.  I'm not sure if this is a bug or if I have something misconfigured.  

 


YAF 4.x User
Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago
The problem is inside the controllers the link builder isn't aware or the area.

I already resolved this issue by setting an area name in the appsettings...

https://github.com/YAFNET/YAF.SampleWebApplication/blob/afdff70d5d34919263fdd85bf8a01682df6c3769/YAF.SampleApp/appsettings.json#L31 

Then the link bilder generates the correct link. This will be fixed in 4.0.0 beta 6

kheiser
  • kheiser
  • 72.4% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
6 months ago
I was still seeing the quick reply issue after the last update.  In line with some of the other changes you made, I changed line 260 in PostsModalController.cs to 


                new { m = newMessage.ID, t = this.PageBoardContext.PageTopicID, name = this.PageBoardContext.PageTopic.TopicName }));

This seems to fix the issue.  

It looks like there are other places where a similar change might be applied, but I haven't found any specific bugs around it, so I'm not sure.


YAF 4.x User
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
6 months ago
This affects all message links. They all do not work if the topic id is not provided. I split up the posts page in to a post page. 

Now it generates topic links like...

/Posts/[topicID]/topic-name

and post  links like...

/Post/[PostID]/topic-name