Skip to content

[RTM] Hotfix for edit/override all in DCG#1196

Merged
stefanheimes merged 1 commit intohotfix/2.0.0-alpha18from
hotfix/#1098_override_edit_all
Mar 4, 2018
Merged

[RTM] Hotfix for edit/override all in DCG#1196
stefanheimes merged 1 commit intohotfix/2.0.0-alpha18from
hotfix/#1098_override_edit_all

Conversation

@baumannsven
Copy link
Copy Markdown
Member

@baumannsven baumannsven commented Sep 21, 2017

This pull request must merged to if DCG has the feature "uniformTime" override/edit all

@baumannsven
Copy link
Copy Markdown
Member Author

@zonky2 zonky2 self-requested a review September 21, 2017 08:31
@zonky2 zonky2 added DC_General This ticket originated from or is directly related to DCG enhancement This issue is about an enhancement (aka new feature) labels Sep 21, 2017
@zonky2 zonky2 added this to the 2.0.0 milestone Sep 21, 2017
Copy link
Copy Markdown
Contributor

@zonky2 zonky2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RTM

@zonky2 zonky2 changed the title [WIP] Hotfix for edit/override all in DCG [WIP] Hotfix for edit/override all in DCG: uniformTime Sep 21, 2017
@baumannsven baumannsven force-pushed the hotfix/#1098_override_edit_all branch from ad58d46 to 11d740b Compare September 21, 2017 09:07
@baumannsven baumannsven changed the title [WIP] Hotfix for edit/override all in DCG: uniformTime [WIP] Hotfix for edit/override all in DCG Sep 21, 2017
@baumannsven
Copy link
Copy Markdown
Member Author

@zonky Don´t edit the label of this pull request show in the commit. This isn´t only for uniform time.

@zonky2
Copy link
Copy Markdown
Contributor

zonky2 commented Sep 21, 2017

na jut

@baumannsven baumannsven changed the title [WIP] Hotfix for edit/override all in DCG [RTM] Hotfix for edit/override all in DCG Sep 21, 2017
Copy link
Copy Markdown
Contributor

@dmolineus dmolineus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this PR provides a new hidden depedency and using MM outside the DCG wouldn't be possible anymore, I disapprove this PR.

Comment thread src/MetaModels/MetaModel.php Outdated
*/
public function saveItem($objItem)
{
$editInformation = $GLOBALS['container']['dc-general.edit-information'];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like it at all. We shouldn't add hidden dependencies. The MM or Item interface should provide a way to handle it.

I suggest following. As we are still in alpha, we could break the API without bumping the major version.

public function saveItem($objItem, $setTimestamp = true);

Then the DCG data provider could handle it.

After merging this PR it wouldn't be possible to use MM outside of the DCG context!

I'm also not sure if the edit information class is needed at all. The DCG models provide a way for meta data. But let's discuss it in the DCG related PR.

@zonky2 zonky2 added Up for discussion This ticket will be up for discussion in one of our next calls and removed Up for discussion This ticket will be up for discussion in one of our next calls labels Sep 26, 2017
Copy link
Copy Markdown
Member

@discordier discordier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm with @dmolineus on this one.

@baumannsven baumannsven force-pushed the hotfix/#1098_override_edit_all branch from 11d740b to 6c8d36b Compare February 23, 2018 11:55
@baumannsven baumannsven changed the base branch from master to hotfix/2.0.0-alpha18 February 23, 2018 11:56
@baumannsven
Copy link
Copy Markdown
Member Author

@dmolineus @discordier I have remove the hidden dependency

@baumannsven baumannsven force-pushed the hotfix/#1098_override_edit_all branch from 6c8d36b to 76b9def Compare February 23, 2018 12:00
@baumannsven baumannsven changed the title [RTM] Hotfix for edit/override all in DCG [WIP] Hotfix for edit/override all in DCG Feb 23, 2018
@dmolineus
Copy link
Copy Markdown
Contributor

This change request modifies interfaces so we have backward compatibility issues here. Probably better to add it only for MM 2.1. Wdyt @discordier?

@discordier
Copy link
Copy Markdown
Member

As there are default values on the interface, any existing concrete class should still work.

However should trigger an deprecation notice if not given.

@baumannsven baumannsven force-pushed the hotfix/#1098_override_edit_all branch from 76b9def to 9d47a24 Compare February 27, 2018 14:53
* @throws \RuntimeException When an incompatible item was passed, an Exception is being thrown.
*/
public function save(ModelInterface $objItem)
public function save(ModelInterface $objItem, $timestamp = 0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tstamp should be passed to $objItem->getItem()->save(); below!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also should trigger a

@trigger_error('Not passing a timestamp has been deprecated and will cause an error in MetaModels 3', E_USER_DEPRECATED);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have taken note of this

* @throws \RuntimeException When an incompatible item was passed.
*/
public function saveEach(CollectionInterface $objItems)
public function saveEach(CollectionInterface $objItems, $timestamp = 0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also should trigger a

@trigger_error('Not passing a timestamp has been deprecated and will cause an error in MetaModels 3', E_USER_DEPRECATED);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have taken note of this

public function saveEach(CollectionInterface $objItems, $timestamp = 0)
{
foreach ($objItems as $objItem) {
$this->save($objItem);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp should get passed here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have taken note of this

Comment thread src/MetaModels/Item.php
public function save()
public function save($timestamp = 0)
{
$objMetaModel = $this->getMetaModel();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also should trigger a

@trigger_error('Not passing a timestamp has been deprecated and will cause an error in MetaModels 3', E_USER_DEPRECATED);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have taken note of this

*/
public function saveItem($objItem)
public function saveItem($objItem, $timestamp = 0)
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also should trigger a

@trigger_error('Not passing a timestamp has been deprecated and will cause an error in MetaModels 3', E_USER_DEPRECATED);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have taken note of this

@baumannsven baumannsven force-pushed the hotfix/#1098_override_edit_all branch 2 times, most recently from 66c5211 to f4628df Compare February 27, 2018 16:39
Copy link
Copy Markdown
Member

@discordier discordier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baumannsven The deprecation notice of course should only get triggered when $timestamp === null(and therefore has not been passed!

…ction

- Input screen condition don´t format the model label if in property selection mode by edit/override all
@baumannsven baumannsven force-pushed the hotfix/#1098_override_edit_all branch from f4628df to 407166a Compare February 28, 2018 09:34
@baumannsven
Copy link
Copy Markdown
Member Author

@discordier I put the deprecated notification in an if statement and change the default timestamp value from 0 to null

@discordier
Copy link
Copy Markdown
Member

@dmolineus, @stefanheimes could you re-evaluate this PR and either approve or request changes?

@baumannsven baumannsven changed the title [WIP] Hotfix for edit/override all in DCG [RFC] Hotfix for edit/override all in DCG Mar 1, 2018
@zonky2 zonky2 removed the request for review from stefanheimes March 1, 2018 08:24
@baumannsven baumannsven changed the title [RFC] Hotfix for edit/override all in DCG [RTM] Hotfix for edit/override all in DCG Mar 1, 2018
@stefanheimes stefanheimes merged commit 407166a into hotfix/2.0.0-alpha18 Mar 4, 2018
@discordier discordier deleted the hotfix/#1098_override_edit_all branch March 6, 2018 12:26
discordier added a commit that referenced this pull request Mar 10, 2018
Stable release 2.0.0

In addition to all the changes in the previous betas, this release
contains the following fixes and enhancements.

Fixes:
- MySQL strict mode fixes.
- Many language strings are updated.
- Language strings for system columns have been moved from
  attribute_alias to the core (see MetaModels/attribute_alias#22).
- Support for responsive image sizes has been added (#1211).
- Optimization in backend CSS (see #1174).
- Bugfix in file sorting by file name (#1217).
- Huge refactorings in all places to finally reduce the complexity
  of all classes into acceptable ranges.
- Fixes for various minor issues and glitches (#1139, #1138)
- Add label and description for filter items (#1221)
- The URL parameter of filter settings has been moved to the
  "frontend filter" backend section.
- The search in "all languages" checkbox has been restored for
  searching in translated attributes (#1203, #1204).
- The "edit all/override all" button has been disabled for input
  screens.
- Do not override multiple for table "tl_metamodel" (#1223).
- The setting "skipfilteroptions" in filter settings now defaults to
  "off" (PR: #1224, discussion in #1089).

Enhancements:
- The feature "edit all" and "override all" which has been added to
  dc-general recently is supported now (#1196, #1098,
  contao-community-alliance/dc-general#359).
- Attribute types are now sorted with first the non-translated ones
  followed by the translated ones in the attribute edit mask in the
  type selection widget (#1219).
- The minimum versions of all dependencies have been raised to the
  current stable versions available.
discordier added a commit that referenced this pull request Mar 10, 2018
Stable release 2.0.0

In addition to all the changes in the previous betas, this release
contains the following fixes and enhancements.

Fixes:
- MySQL strict mode fixes.
- Many language strings are updated.
- Language strings for system columns have been moved from
  attribute_alias to the core (see MetaModels/attribute_alias#22).
- Support for responsive image sizes has been added (#1211).
- Optimization in backend CSS (see #1174).
- Bugfix in file sorting by file name (#1217).
- Huge refactorings in all places to finally reduce the complexity
  of all classes into acceptable ranges.
- Fixes for various minor issues and glitches (#1139, #1138)
- Add label and description for filter items (#1221)
- The URL parameter of filter settings has been moved to the
  "frontend filter" backend section.
- The search in "all languages" checkbox has been restored for
  searching in translated attributes (#1203, #1204).
- The "edit all/override all" button has been disabled for input
  screens.
- Do not override multiple for table "tl_metamodel" (#1223).
- The setting "skipfilteroptions" in filter settings now defaults to
  "off" (PR: #1224, discussion in #1089).

Enhancements:
- The feature "edit all" and "override all" which has been added to
  dc-general recently is supported now (#1196, #1098,
  contao-community-alliance/dc-general#359).
- Attribute types are now sorted with first the non-translated ones
  followed by the translated ones in the attribute edit mask in the
  type selection widget (#1219).
- The minimum versions of all dependencies have been raised to the
  current stable versions available.
discordier added a commit that referenced this pull request Dec 19, 2018
Stable release 2.0.0

In addition to all the changes in the previous betas, this release
contains the following fixes and enhancements.

Fixes:
- MySQL strict mode fixes.
- Many language strings are updated.
- Language strings for system columns have been moved from
  attribute_alias to the core (see MetaModels/attribute_alias#22).
- Support for responsive image sizes has been added (#1211).
- Optimization in backend CSS (see #1174).
- Bugfix in file sorting by file name (#1217).
- Huge refactorings in all places to finally reduce the complexity
  of all classes into acceptable ranges.
- Fixes for various minor issues and glitches (#1139, #1138)
- Add label and description for filter items (#1221)
- The URL parameter of filter settings has been moved to the
  "frontend filter" backend section.
- The search in "all languages" checkbox has been restored for
  searching in translated attributes (#1203, #1204).
- The "edit all/override all" button has been disabled for input
  screens.
- Do not override multiple for table "tl_metamodel" (#1223).
- The setting "skipfilteroptions" in filter settings now defaults to
  "off" (PR: #1224, discussion in #1089).

Enhancements:
- The feature "edit all" and "override all" which has been added to
  dc-general recently is supported now (#1196, #1098,
  contao-community-alliance/dc-general#359).
- Attribute types are now sorted with first the non-translated ones
  followed by the translated ones in the attribute edit mask in the
  type selection widget (#1219).
- The minimum versions of all dependencies have been raised to the
  current stable versions available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DC_General This ticket originated from or is directly related to DCG enhancement This issue is about an enhancement (aka new feature)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants