greg_808
greg_808 in #cms4 2020-02-10 13:37:59 (edited) (deleted)

I am not quiet sure if i understand you right but have you looked at https://docs.silverstripe.org/en/4/developer_guides/forms/how_tos/create_a_gridfield_actionprovider/

Show 1 attachment(s)
docs.silverstripe.org  
Create a GridField action provider

Developer and user documentation for the Silverstripe CMS and framework.

Hide attachment content
greg_808

Does anyone know how long a shopping cart will last if it is not ordered?

greg_808

Is there a module that adds a confirm dialog to gridfield actions

greg_808

yes i am running on Fluent 4.4.4. I wasn’t able to find out when the new siteconfigs are added.

blueskies

An issue was raised about the extra SiteConfig records here: https://github.com/tractorcow-farm/silverstripe-fluent/issues/495 Hopefully we'll get to the bottom of it. Do you have any extra info to post? Or can you confirm you see the issue with a plain custom SiteConfig?

Show 1 attachment(s)
derralf

Hi,
I've got a weird problem with Siteconfig.

SiteConfig has extension CustomSiteConfig
SiteConfig has fluent extension
(see config below)

Somehow:

• multiple SiteConfig-Rows are created in DB • for the multiple SiteConfig-Rows localised are created • the right translations are not found

See Example below.

In the Backend I see the translations (SiteConfig ID 1 gets translated, see below).
But no translation is shown in Frontend or accessible via PHP*. Seems like the CMS thinks the fields are NULL (see below)

* e.g.
$SiteConfig = SiteConfig::current_site_config();
var_dump($SiteConfig->MailTo);

mysite.yml

---
Name: myproject
---
...
SilverStripe\SiteConfig\SiteConfig:
  extensions:
    - App\Extension\CustomSiteConfig

fluentconfig.yml

---
Name: myfluentconfig
After:
  - '#versionedfiles'
  - '#myproject'
---
...
...
SilverStripe\SiteConfig\SiteConfig:
  extensions:
    - 'TractorCow\Fluent\Extension\FluentExtension'
  translate:
    - 'Title'
    - 'Tagline'
    - 'MailSubject'
    - 'MailThankYouMessage'
    - 'ContactMapInfoWindowTitle'
    - 'ContactMapInfoWindowAddress'
...
...

Table SiteConfig

The "NULL-Fields" are not shown in CMS, all fields seem to have been filled out.
The following returns NULL in it_IT and de_DE though "mailto:[email protected]|[email protected]" is shown in Backend in all Languages:

$SiteConfig = SiteConfig::current_site_config();
var_dump($SiteConfig->MailTo);

Table SiteConfig_Localised

Values from ID 2 and 4 are shown in Frontend.
Values from ID 3 and 5 shown in Backend.
So the shown/displayed values can not be edited. And the values that I can edit are not used/shown in Frontend/PHP.

Edit:
If I use class CustomSiteConfig extends FluentExtension
I get this Error:
[Emergency] Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query: ALTER TABLE "SiteConfig_Localised" DROP INDEX "Fluent_Record", ADD unique "Fluent_Record" ("RecordID","Locale","RecordID","Locale") 42S21-1060: Duplicate column name 'RecordID'

Hide attachment content
greg_808

I changed this

  1. public function getTableTitle()
  2. {
  3. $product = $this->Product();
  4. $tabletitle = ($product) ? $product->Title : $this->i18n_singular_name();
  5. $this->extend('updateTableTitle', $tabletitle);
  6.  
  7. return $tabletitle;
  8. }

to

  1. public function getTableTitle()
  2. {
  3. $product = $this->Product() ?? $this->getComponent('Product');
  4. $tabletitle = ($product) ? $product->Title : $this->i18n_singular_name();
  5. $this->extend('updateTableTitle', $tabletitle);
  6.  
  7. return $tabletitle;
  8. }

it works as expected.

👍 (2)