When I merged the latest Pier code with the Pier for Seaside 3.0 branch I
noticed that the Pier logo wasn't appearing on the initial screen, although
it appeared on the 3.0 branch prior to the merge.
I traced the difference in behaviour down to a code change in
PRViewCommand>>initialRequest
the pre-merge version:
initialRequest: aRequest
| viewClass |
super initialRequest: aRequest.
viewClass := PRPierFrame
classFromRequest: aRequest
name: 'view'
base: PRViewComponent.
(viewClass isNil and: [ self structure isFile ])
ifTrue: [ viewClass := PRDownloadView ].
(viewClass notNil and: [ viewClass isValidIn: self context ])
ifTrue: [ self viewComponentClass: viewClass ].
self viewComponent visiblePresentersDo: [ :each | each initialRequest:
aRequest ].
(self viewComponent isFullResponse)
ifTrue: [ self viewComponent handle: WACurrentRequestContext value ]
post-merge version:
initialRequest: aRequest
| viewClass |
super initialRequest: aRequest.
viewClass := PRPierFrame
classFromRequest: aRequest
name: 'view'
base: PRViewComponent.
(viewClass notNil and: [ viewClass isValidIn: self context ])
ifTrue: [ self viewComponentClass: viewClass ].
self viewComponent visiblePresentersDo: [ :each | each initialRequest:
aRequest ].
(self viewComponent isFullResponse)
ifTrue: [ self viewComponent handle: WACurrentRequestContext value ]
the pre-merge version has the addition of the code: (viewClass isNil and: [
self structure isFile ]) ifTrue: [ viewClass := PRDownloadView ].
However this code isn't present in the main 2.8 code-base. The problem is
more subtle. The pier environment stylesheet requests an image from:
'/seaside/pier/environment/pier.png?view=PRDownloadView' this is trapped by
the code in WAOldPathComptibilityRequestHandler which issues a 301 moved
permanently redirect to '/pier/environment/pier.png'. The problem is that
during the redirection the url parameters have been lost. I've fixed the
problem locally by changing
WAOldPathComptibilityRequestHandler>>handleFiltered: from:
handleFiltered: aRequestContext
| url |
url := aRequestContext request url copy.
url path removeFirst.
aRequestContext response
movedPermanently;
location: url.
aRequestContext respond
to:
handleFiltered: aRequestContext
| url |
url := aRequestContext request url copy.
url path removeFirst.
url parameters: aRequestContext request fields.
aRequestContext response
movedPermanently;
location: url.
aRequestContext respond
I copy the parameters from the request to the url. Should I save this change
into seaside 3.0 repositories? Or is there something else that needs fixing
higher up the call stack to account for why the parameters haven't been
added to the WAUrl object?
Hope this all makes sense
Nick