Questions tagged [silverstripe-4]

Silverstripe 4 is the latest major version of the Silverstripe open source CMS and framework. Version 4.0.0 was released on 8th Nov 2017.

For a high level overview of changes to Silverstripe 4 from Silverstripe 3 and an upgrade guide, see the 4.0.0 changelog.

350 questions
3
votes
1 answer

SilverStripe ORM where clause on relations and its count

I am working on a SilverStripe project. Now I am querying the data. What I am trying to do is getting all the records running where clause on the count of its relations. The below query will get all the NewsPage records. NewsPage has many blogs. So,…
Wai Yan Hein
  • 13,651
  • 35
  • 180
  • 372
3
votes
1 answer

How to limit object access to $has_one Member in Silverstripe?

I'm working on a Silverstripe 4.3.1 project which has an object with an owner member attached via $has_one: class Object extends DataObject { private static $has_one = [ 'Member' => Member::class, ]; We want to limit the ability to…
BaronGrivet
  • 4,364
  • 5
  • 37
  • 52
3
votes
1 answer

SilverStripe 4.3.1 - Convert default boolean value to Yes or No from SS 4.2.1

I have successfully created a gallery landing page that pulls a specified child album cover image to itself. This works perfectly in SS 4.2.1 I then created a new SS 4.3.1 and copied over all the templates. Everything is working except for this…
3
votes
0 answers

Multiple Templates not loading

I am having an issue loading multiple templates, and trying to follow this guide, https://www.silverstripe.org/learn/lessons/v4/working-with-multiple-templates-1 In my app/src I have... Homepage.php
Shawn W
  • 566
  • 4
  • 13
3
votes
1 answer

"Couldn't find object" error with Silverstripe 4 unit testing, how to fixed it?

"Couldn't find object" error with Silverstripe 4 unit testing, how to fixed it?. with silverstripe 4 unit test, im getting a error "Couldn't find object 'transaction1' ". can anyone suggest what's happening here?. Thanks. class…
kosala manojeewa
  • 329
  • 3
  • 11
3
votes
1 answer

silverstripe 4 has_many relationship giving errors

getting this error; [Emergency] Uncaught InvalidArgumentException: has_many relation abc\def\ghi\Customer.OrderRegistrants references class Order which doesn't exist private static $has_many = [ 'OrderRegistrants' =>…
kosala manojeewa
  • 329
  • 3
  • 11
3
votes
1 answer

How to add a css style to an element in the HTMLEditorField content editor in Silverstripe 4?

In SS 3.x we could use the following code to add custom elements into the HTMLEditorField content editor via the Styles dropdown. My main use for this was to turn a standard link into a styled button link. How can we achieve this in SS 4.x? This is…
ifusion
  • 2,163
  • 6
  • 24
  • 44
3
votes
2 answers

Silverstripe 4 SapphireTest class can't be found

I've upgraded from SilverStripe 3 to 4 and now my phpUnit tests own't run because they can't find any of my Custom Classes. There must be something missing from an autoloader or something. I have a simple test like this use…
wild
  • 311
  • 4
  • 11
3
votes
1 answer

Upgrading to Silverstripe 4.1.0 getting Fatal error: Class 'PageController' not found in ErrorPageController.php?

I am upgrading a Silverstripe 3.6.5 site to 4.1.0, just going through the upgrading process. I have struck a hurdle. I am getting this error: Fatal error: Class 'PageController' not found in…
ifusion
  • 2,163
  • 6
  • 24
  • 44
3
votes
1 answer

How to automaticly publish images in silverstripe dataextension

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…
3
votes
1 answer

Upload image with UploadField in frontend form Silverstripe 4.0

I'm not able to upload pictures through the front end form in Silverstripe. I have looked at the example on this page but it didn't help me. Updating text fields is working fine. My code is posted below, what have I missed? public function…
3
votes
0 answers

How to include a static image in the template with SilverStripe 4? $ThemeDir is not working

Can anyone please show me how to include a static image in my template with SilverStripe 4? Because $ThemeDir is not working. E.g. is not working.
Brendan
  • 834
  • 1
  • 9
  • 20
3
votes
1 answer

Auto generating SilverStripe admin links

So I have a DataObject that I manage via Model Admin via the standard gridfield (using Silverstripe 4) I would like to be able to generate a link to edit this object directly the admin. I can do this if I manually enter the ModelAdmin URL, but this…
PsychoMo
  • 699
  • 5
  • 17
3
votes
1 answer

Silverstripe File relation in ModelAdmin doesnt publish

Im using SilverStripe4 and the ModelAdmin to manage DataObjects. The DataObject has a has_one on File. Everything works so far but on frontend controller the File relation has an empty object. I see that the file is not in the File_Live table, so…
ivoba
  • 5,780
  • 5
  • 48
  • 55
2
votes
1 answer

How can I run a BuildTask task via the command line in SilverStripe 4?

In the SilverStripe 4 documentation, it says I can extend the DevBuild class and call the task using cron in a unix commandline. https://docs.silverstripe.org/en/4/developer_guides/cli/#running-regular-tasks-with-cron I've written a class called…
James
  • 51
  • 5
1
2
3
23 24