wmk

oh > 7.4 is expected to be the LAST branch of the PHP 7 series. Watch for PHP 8 in 2020.

wmk

MG... and when will "solr in action" be updated? Or are the core concepts still the same and a new major version just has some cosmetic upgrades?

firesphere

What do you mean with "Solr in action" to be updated?

wmk

This great and we'll written book is still about solr 4

wmk

@StefGuev with a custom template for this form, why not?

wmk

I used <time datetime="$Start.Rfc3339"> in my templates to get the formatted code in SS4

wmk

@nightjarnz https://github.com/silverstripe/silverstripe-framework/issues/8857 this confused me long time ago, then you told me "a getter method isn't supposed to have an argument"

Show 1 attachment(s)
jonom

Affected Version

4.3.2 (and probably others)

Description

If a controller method is prefixed with get but called in a template without the prefix, arguments passed in the template are not passed to the method.

I'm not sure if this is strictly a bug as I couldn't find a lot of documentation about getters, but my understanding of the convention in SilverStripe is that getMethod() is expected to work the same as Method().

Perhaps by convention getters shouldn't accept arguments but thought this was worth reporting anyhow. Surfaced by this <https://forum.silverstripe.org/t/how-do-i-pass-parameters-from-template-to-class-methods/1734|forum post>.

Steps to Reproduce Not prefixed with get

Page controller:

public function Foo() {
    return 'Foo';
}

public function Bar($bar='Bar') {
    return $bar;
}

Page template: $Foo $Bar(Foo)
Expected result: "Foo Foo"
Actual result: "Foo Foo" :white_check_mark:

Prefixed with get (method only)

Page controller:

public function getFoo() {
    return 'Foo';
}

public function getBar($bar='Bar') {
    return $bar;
}

Page template: $Foo $Bar(Foo)
Expected result: "Foo Foo"
Actual result: "Foo Bar" :x:

Prefixed with get (method and template)

Page controller:

public function getFoo() {
    return 'Foo';
}

public function getBar($bar='Bar') {
    return $bar;
}

Page template: $getFoo $getBar(Foo)
Expected result: "Foo Foo"
Actual result: "Foo Foo" :white_check_mark:

Hide attachment content
nightjarnz

A little more nuanced than that @wmk :) But when it comes to templates, and you're looking up non-extant "properties" then yes, no parameters!

wmk

But why does IIS send a 404 when the query string is too long, instead of a 414 - uri too long error?

wmk

@alt thanks, got it fixed - hopefully. I have a site where some logger send stuff to a script, it seems it errored cause the query string was too long. For some reason the logs say "404" which is pretty confusing. I was able to add a web.config to the specific subdir and hopefully it will work when the next logs are sent

wmk

anyone with IIS / web.config experience around?

wmk

Never used that, so I hope I interpreted the docs correctly. It's so easy nowadays to setup one VirtualHost per site that I don't need it myself.

 

[2019-03-22 08:24:05] manifestcache-log.WARNING: Failed to save values {"keys":["__CACHE__"],"exception":null} []