silverstripe-4

How to build a React app (containing SVG files) inside a SilverStripe project so SS4 folder conventions are maintained?

落爺英雄遲暮 提交于 2019-12-11 04:51:11
问题 I have been using npm run build to create build files for my React project which automatically produces three folders in the build directory inside the React project static/js , static/css and static/media (containing the SVG files). The first two folders static/js and static/css can be dealt with by using the SilverStripe Requirements class on the init method of the ReactPageController (the PageController for the SilverStripe layout with the nested React app), adding the paths to the

In SilverStripe 4, how to extend an existing method when there is no Extension Hook inside the original method?

人盡茶涼 提交于 2019-12-11 00:55:47
问题 I want to override 'loginForm' method in 'LoginHandler' class. I am trying to use the code given below for that. But it is not working. LoginHandlerExtension.php <?php use SilverStripe\Core\Extension; class LoginHandlerExtension extends Extension { public function loginForm() { return 'xxxxxx'; } } app.yml SilverStripe\Security\MemberAuthenticator\LoginHandler: extensions: - LoginHandlerExtension 回答1: What would you want to override on the loginForm method? If you want it to use a different

SIlverStripe - No data written onBeforeWrite

落爺英雄遲暮 提交于 2019-12-10 12:14:09
问题 Related to this issue, a DataObject extended with onBeforeWrite method doesn't write a specific property value on DB. In detail: DataObject: [...] /** * Classe Prodotto */ class Prodotto extends DataObject { // Dichiarazione Proprietà private static $db = [ [...] 'PrezzoIva' => 'Currency', [...] onBeforeWrite method: /** * Metodo gestione azioni salvataggio * Calcolo automatico prezzo lordo e scontato * Setter * @return void */ public function onBeforeWrite() { // Controllo Record if (!$this-

SilverStripe - Undefined Index on DataObject onBeforeWrite

陌路散爱 提交于 2019-12-08 13:43:24
问题 Following the official SS guide on DataObject extension, I'm occurring on this exception: PHP Notice: Undefined index: PrezzoIva Project panorama: a value must be computed and saved in pair with the other DataObject properties, before the main write() execution. Here's the situation (on SS 4.0.3): [...] /** * Classe Prodotto */ class Prodotto extends DataObject { // Dichiarazione Proprietà private static $db = [ [...] 'PrezzoIva' => 'Currency', [...] onBeforeWrite method: /** * Metodo

Silverstripe 4 - Authenticator class not found

谁说胖子不能爱 提交于 2019-12-07 19:51:18
问题 I would allow pre-generated users to log out from a SilverStripe 4 website front-end page, by using the default from. Logging out because log in works. The problem is that if a logged generic user tries to log out by clicking on a link like Security/logout (as well as Security/logout?BackURL=home/ ), it being redirected to a blank page (just with header/footer visible, as the default Page.ss is implemented). Apparently the controller doesn't work or similar, because URL points me simply to

How to automaticly publish images in silverstripe dataextension

泄露秘密 提交于 2019-12-07 15:06:54
问题 I was trying to add an uploadfield to a Custom DataExtension and got the Image field working. However the image i uploaded stays in concept mode, and i have to go to the File tab to publish it. I tried to use the code provided in the Silverstripe documentation but this only seems to work on regular pages. I found a question similar to mine:How to automaticaly publish files uploaded to a dataobject in Silverstripe model admin however this only seems to work on DataObjects. This is my current

SilverStripe 4 - Blank page on logging out

坚强是说给别人听的谎言 提交于 2019-12-06 15:29:27
As I stated here , I would allow pre-generated users to log out from a SilverStripe 4 website front-end page, by using the default from. Logging out because log in works. The problem is that if a logged generic user tries to log out by clicking on a link like Security/logout (as well as Security/logout?BackURL=home/ ), it being redirected to a blank page (just with header/footer visible, as the default Page.ss is implemented). Apparently the controller doesn't work or similar, because URL points me simply to Security/logout with no following redirects. Furthermore, the session is not being

Silverstripe 4 - Authenticator class not found

隐身守侯 提交于 2019-12-06 14:08:06
I would allow pre-generated users to log out from a SilverStripe 4 website front-end page, by using the default from. Logging out because log in works. The problem is that if a logged generic user tries to log out by clicking on a link like Security/logout (as well as Security/logout?BackURL=home/ ), it being redirected to a blank page (just with header/footer visible, as the default Page.ss is implemented). Apparently the controller doesn't work or similar, because URL points me simply to Security/logout with no following redirects. So, I tried to implement a custom authenticator, as I

How to insert (inject?) an existing React app (just a UI without a backend) into a SilverStripe page layout?

人盡茶涼 提交于 2019-12-02 11:43:30
问题 My question is: I have been reading the SilverStripe 4 documentation in order to find a way to insert an existing React app (just a UI of nested React components without a backend) into a SilverStripe page layout. Is this possible and how do you make sure SilverStripe has the right dependencies? My research so far attempting to answer this question: As a traditional React project uses NPM (node package manager) to get all the correct dependencies and Node.js as a server, I am wondering how to

How to insert (inject?) an existing React app (just a UI without a backend) into a SilverStripe page layout?

这一生的挚爱 提交于 2019-12-02 07:22:05
My question is: I have been reading the SilverStripe 4 documentation in order to find a way to insert an existing React app (just a UI of nested React components without a backend) into a SilverStripe page layout. Is this possible and how do you make sure SilverStripe has the right dependencies? My research so far attempting to answer this question: As a traditional React project uses NPM (node package manager) to get all the correct dependencies and Node.js as a server, I am wondering how to approach this as my SilverStripe project runs on an Apache server. I have found this package, do I