#1 2017-03-26 23:27:41

hnb
Member
Registered: 2015-06-15
Posts: 291

Possible MVC blog demo regression

Hi,

I am not sure but probable we have regression for MVC demo. The problem is visible for logged user (in this case synopse). Seems that Mustache won't work anymore for sets (like in ArticleView.html):

{{#main.session.AuthorRights.canComment}}

In case of "ArticleView.html view" the logged user can't comment articles anymore. Could someone confirm that?


best regards,
Maciej Izak

Offline

#2 2017-03-27 08:34:57

hnb
Member
Registered: 2015-06-15
Posts: 291

Re: Possible MVC blog demo regression

hnb wrote:

I am not sure but probable we have regression for MVC demo

hmm. Seems that sample "30 - MVC Server" is broken for long time ("Add Comment" functionality is not displayed). Tested with latest mORMot on Delphi and FPC, also very old mORMot (I use for test purposes old version from 2015 January) is broken so this bug is not new :\ ...


best regards,
Maciej Izak

Offline

#3 2017-03-27 16:15:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Possible MVC blog demo regression

The view was incorrect, not the framework... wink
See https://synopse.info/fossil/info/288dc03168

To check the expected execution context of a given page, add /json to the URI:
http://localhost:8092/blog/ArticleView?id=10000&withComments=true#comments
into
http://localhost:8092/blog/ArticleView/json?id=10000&withComments=true#comments

Then you can see the context:

...
"main": {
		"pageName": "ArticleView",
		"blog": {
			"Title": "mORMot BLOG",
			"Language": "en",
			"Description": "Sample Blog Web Application using Synopse mORMot MVC",
			"Copyright": "&copy;2015 <a href=http://synopse.info>Synopse Informatique</a>",
			"About": "Bla? Ble, bla ble, bli bla ble blu ble. Blo blu. Bla ble, blu bla blu blu bli blu blu bla, bli blo blo blo bli bli blu blo.\r\nBlo bla!"
		},
		"session": {
			"AuthorName": "synopse",
			"AuthorID": 1,
			"AuthorRights": {
				"Comment": true,
				"Post": true,
				"Delete": true,
				"Administrate": true
			},
			"id": 1
		},...

Here can see that the expected value is "Comment", not "canComment"...

Offline

#4 2017-03-27 20:47:43

hnb
Member
Registered: 2015-06-15
Posts: 291

Re: Possible MVC blog demo regression

Nice trick with /json, thanks smile. I think that we have problem in framework. "AuthorRights" works correctly only for FPC, Delphi (in my case XE2) shows

"AuthorRights":15,

instead of

"AuthorRights": {
	"Comment": true,
	"Post": true,
	"Delete": true,
	"Administrate": true
}

ArticleView is still buggy in Delphi.


best regards,
Maciej Izak

Offline

#5 2017-03-28 07:23:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Possible MVC blog demo regression

In fact, sounds like if it never worked since Delphi 2010: you needed to define the record layout by text for proper set serialization.
Should be fixed by https://synopse.info/fossil/info/d55a66ff4a

So it worked correctly with FPC or Delphi 7...
smile

Offline

#6 2017-03-29 11:12:42

hnb
Member
Registered: 2015-06-15
Posts: 291

Re: Possible MVC blog demo regression

Finally works as expected smile. Btw. amazing experience: VPS server with own blog/small site with https without any "apache". Just Debian + FPC mORMot application + nginx on the front.

Did we have any plans to support HTTPS via SynOpenSSL in near future? If yes then probably will be possible to drop nginx (maybe not at all if someone needs load balancing)!


best regards,
Maciej Izak

Offline

Board footer

Powered by FluxBB