View more context

 

CptPillow

@jkersu I get the following error when doing that: [Emergency] Uncaught InvalidArgumentException: Missing spec class

jkersu

Looks like theres a issue where the old url stops working but the new one works: https://github.com/silverstripe/silverstripe-admin/issues/689

Show 1 attachment(s)
DorsetDigital

Tested on Silverstripe 4.1.1 and 4.2.1

When changing the admin route by adding the following YML (as per the docs):

---
Name: myadmin
After:
- '#adminroutes'
---
SilverStripe\Control\Director:
  rules:
    'admin': ''
    'cms': 'SilverStripe\Admin\AdminRootController'

The new URL becomes active and works correctly. The old URL (eg. http://example.com/admin|example.com/admin) now throws a 500 error (below). I would expect it to return a 404.

Uncaught InvalidArgumentException: Missing spec class
GET /admin
Line 403 in /app/vendor/silverstripe/framework/src/Core/Injector/Injector.php

The full stack trace is attached.
https://github.com/silverstripe/silverstripe-admin/files/2482545/admin_error_trace.txt|admin_error_trace.txt

Hide attachment content
jkersu

Try removing this line maybe? 'admin': ''

CptPillow

taking that line out makes /admin work but it shouldnt be that

jkersu

Ok try this the following. I tried it on my machine and it works 🙂

  1. ---
  2. Name: myadmin
  3. After:
  4. - '#adminroutes'
  5. ---
  6. SilverStripe\Control\Director:
  7. rules:
  8. 'admin': ''
  9. 'cms': 'SilverStripe\Admin\AdminRootController'
  10.  
  11. SilverStripe\Admin\AdminRootController:
  12. url_base: 'cms'
  13. ---
jase_mc

Hello 🙂 I have some DataObjects setup, and when viewing via the modeladmin list, any summary fields that are of type HTMLText display the raw HTML in the summary list I have tried adding a summary field to the object. e.g. DescriptionSummary, with a custom getDescriptionSummary() function that makes a ->plain() call on the field to remove the HTML from display. This works. except it seems to cause an error in the Search function . a SQL error 'Field not Found: DescriptionSummary'. Could anyone provide any advice on how to fix that error, or have another way to not display the HTML in the summary list?

theruss
  1. private static $summary_fields = [
  2. ];
theruss

Something like this, should work but doesn't quite do it - the markup still shows in the GridField row:

theruss
  1. private static $summary_fields = [
  2. 'getSummaryDetail' => 'Summary',
  3. ];
  4.  
  5. public function getSummaryDetail() : string
  6. {
  7. return DBField::create_field(DBHTMLText::class, $myMarkupAndHTMLAndStuff);
  8. }
jase_mc

thanks @theruss, I actually found that the specific solution was the

  1. $searchable_fields

var. This avoids the search function trying to search on custom summary fields such as getSummaryDetail

👍 (1)
Dribbles

Think I'm stuck on something pretty simple. I setup a custom CMS Action to duplicate an Event page, which works fine. However, this action is not present when editing this page via Model Admin. Anyone know how to enable it there?

Dribbles

For reference this is where the button should appear

null

Narrator: this is not pretty simple 😞

Admonish

@Dribbles Did you have a look at this Question on Stack Overflow?

Admonish

https://stackoverflow.com/questions/54251162/silverstripe-4-0-4-getcmsactions-not-working-as-expected-on-dataobject

Show 1 attachment(s)
Stack Overflow  
Silverstripe 4.0.4 - getCMSActions not working as expected on dataobject

I am trying to add a copy dataobject button next to the save and delete button on a dataobject but "getCMSActions" does not seem to work. I have followed the tutorials on the following pages: ht...

Hide attachment content
Dribbles

Thanks @Admonish, a friend pointed me towards the same implementation in the above example as well. The button is rendering now, which is great! Thanks for the suggestion


Show less replies
Bidd

Anybody seen this before? Uncaught League\Flysystem\Exception: Impossible to create the root directory "/data/websites/http://www.foo.com/public/assets". Not quoting the scalar "%$SilverStripe\GraphQL\PersistedQuery\GuzzleHTTPClient" starting with the "%" indicator character is deprecated since Symfony 3.1 and willthrow a ParseException in 4.0 on line 15.

theruss

Looks like Symfony (which Silverstripe uses for YML parsing) doesn't like Silverstripe's Injector notation.

theruss

Documented here: https://symfony.com/blog/new-in-symfony-3-1-yaml-deprecations#deprecated-starting-scalars-with-characters

Show 1 attachment(s)
Symfony  
New in Symfony 3.1: YAML deprecations (Symfony Blog)

In Symfony 2.8 we introduced some YAML deprecations to make configuration files compliant with the YAML spec. In Symfony 3.1 we introduced additional deprecations, some of them needed for the new YAML...

Hide attachment content
theruss

I have no idea right now why this would suddenly happen in a Silverstripe 4 application 😕

theruss

Any background information you can provide? When did it stop working and what did you do?

Bidd

Hrm, I think it’s a config error on my behalf

Bidd

Thanks for you reply. I’ll keep going down the route that it’s a fault with something I’ve done. More likely

👍 (1)
Dribbles

This is where the button should appear

Admonish

Can someone please show me how to pass field data to a DataObject using a HiddenField? I'm currently working with a DataObject that is being rendered using ModelAdmin . I have tried the following code in my DataObject:

  1. //...
  2. private static $db = [
  3. 'TotalWorkflowSteps' => "Int",
  4. ];
  5.  
  6. private static $defaults = [
  7. 'TotalWorkflowSteps' => '0',
  8. ];
  9. //...
  10. public function getCMSFields()
  11. {
  12. //...
  13. $fieldList = FieldList::create();
  14. $rootTabSet = new TabSet("Root");
  15. $fieldList->push($rootTabSet);
  16.  
  17. $totalStepsField = new HiddenField("TotalWorkflowSteps", '', 4);
  18. $fieldList->push($totalStepsField);
  19. //...
  20. return $fieldList;
  21. }

This produces the following html:

  1. <input type="hidden" name="TotalWorkflowSteps" value="0" class="hidden" id="Form_ItemEditForm_TotalWorkflowSteps">

It looks like the value that I added is being overwritten by the default value