Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NodeBundle] save on (un)publish #1803

Merged
merged 1 commit into from Jun 15, 2018

Conversation

deZinc
Copy link
Contributor

@deZinc deZinc commented Feb 1, 2018

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets closes #1581

@deZinc deZinc changed the title Fixed issue 1581: save on (un)publish [NodeBundle] save on (un)publish Feb 1, 2018
@sandergo90
Copy link
Contributor

@deZinc Why don't we put the helper methods inside the NodeAdminPublisher server? There is a service for publishing nodes, so maybe this helper can be moved to the service?

@deZinc
Copy link
Contributor Author

deZinc commented Feb 2, 2018

@sandergo90 I thought about that too Sander, but decided to keep the methods in the controller as it's the only place they are used. Moving them however is of course a possibility.

@sandergo90
Copy link
Contributor

I think that it can be moved. It's the right place for it and is not an action that should be in the controller.

@deZinc
Copy link
Contributor Author

deZinc commented Feb 2, 2018

Ok, I'll look into it.

@deZinc deZinc force-pushed the fix/issue-1581-merged branch 2 times, most recently from 28dcd12 to dcd5a04 Compare February 28, 2018 12:07
@deZinc
Copy link
Contributor Author

deZinc commented Feb 28, 2018

@sandergo90 I made the requested changes.

@@ -91,6 +91,7 @@ protected function init(Request $request)
$this->authorizationChecker = $this->get('security.authorization_checker');
$this->user = $this->getUser();
$this->aclHelper = $this->get('kunstmaan_admin.acl.helper');
$this->nodePublisher = $this->get('kunstmaan_node.admin_node.publisher');
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a protected variable for the class.

@@ -57,13 +67,17 @@ public function __construct(
TokenStorageInterface $tokenStorage,
AuthorizationCheckerInterface $authorizationChecker,
EventDispatcherInterface $eventDispatcher,
CloneHelper $cloneHelper
CloneHelper $cloneHelper,
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding extra constructor parameters is BC breaking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, this should now go into 6

$request->get('pub_date') . ' ' . $request->get('pub_time')
);
$this->publishLater($nodeTranslation, $date);
$this->session->getFlashBag()->add(
Copy link
Contributor

Choose a reason for hiding this comment

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

The session can be retrieved from the Request

$this->publishLater($nodeTranslation, $date);
$this->session->getFlashBag()->add(
FlashTypes::SUCCESS,
$this->translator->trans('kuma_node.admin.publish.flash.success_scheduled')
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe pass the translator from the NodeAdminController

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have a look into this, because it means this can be done without a BC break then.
But, I think this is a bit cleaner, so'll make a different PR to go into the 6 branch.

<a href="{{ path('KunstmaanNodeBundle_nodes_publish', { 'id': node.id}) }}" class="btn btn-danger btn--raise-on-hover">
{{ 'kuma_node.modal.publish.now.button'|trans() }}
</a>
<button name="publishing" type="submit" class="btn btn-danger btn--raise-on-hover">{{ 'kuma_node.modal.publish.now.button'|trans() }}</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you removing the form action here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this needs to become part of the bigger form in order for the new functionality to work.

@deZinc
Copy link
Contributor Author

deZinc commented Mar 21, 2018

@sandergo90 Ready, refactored in order to prevent a BC break

@ProfessorKuma ProfessorKuma added this to the 5.0.7 milestone Jun 1, 2018
Copy link

@ProfessorKuma ProfessorKuma left a comment

Choose a reason for hiding this comment

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

Hi @deZinc, your PR needs some changes

  • Your answer if this PR is has deprecations seems to be incorrect.
  • This PR seems to need a milestone of a patch release.

Copy link

@ProfessorKuma ProfessorKuma left a comment

Choose a reason for hiding this comment

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

Hi @deZinc, your PR passed all our requirements.

Thank you for contributing!

@Devolicious Devolicious merged commit a5c72af into Kunstmaan:5.0 Jun 15, 2018
Devolicious added a commit that referenced this pull request Jun 21, 2018
* 5.0:
  recompiled assets
  update changelog
  refactor HeaderPagePart entity test (#2024)
  [NodeBundle] fixed issue 1581, save on (un)publish (#1803)
  Replace deprecated twig raw tag in scss file (#1987)
  [KunstmaanAdminBundle]: fix js for collections (#1989)
  [Docs] set correct paths (#1990)
  [AdminBundle] fixed create user command #1995 (#1996)
JZuidema pushed a commit to e-sites/KunstmaanBundlesCMS that referenced this pull request Jun 22, 2018
Devolicious added a commit that referenced this pull request Jun 26, 2018
* master: (24 commits)
  added missing translations to main language (#2038)
  bump node version (#2035)
  recompile assets after upmerge
  recompiled assets
  update changelog
  [NodeBundle] Split off logic of NodeAdminController in helper class (#2027)
  refactor HeaderPagePart entity test (#2024)
  [AllBundle] move old phpunit style to codeception with fixed coverage (#1955)
  [Docs] remove vagrant references and put some small snippet about docker in (#1953)
  Add target blank to download link (#1963)
  [NodeBundle] fixed issue 1581, save on (un)publish (#1803)
  Replace deprecated twig raw tag in scss file (#1987)
  [KunstmaanAdminBundle]: fix js for collections (#1989)
  [Docs] set correct paths (#1990)
  [AdminBundle] fixed create user command #1995 (#1996)
  [AdminBundle] Deprecate service container usage in commands (#2014)
  [AdminBundle] updated aclApplyCommand to use AclManager (#2003)
  Replace getParameter calls so our code doesn't trigger deprecations (#2012)
  [AdminBundle][MultidomainBundle] Move parameter checks and service definition changes to compiler pass (#2018)
  Mark extra services public (#2013)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants