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

Port Path Alias Delete to D8 #109

Merged
merged 1 commit into from Sep 16, 2014
Merged

Port Path Alias Delete to D8 #109

merged 1 commit into from Sep 16, 2014

Conversation

stephenpurkiss
Copy link
Contributor

Here's an initial stab at the "Delete alias for path". Unsure currently how to deal with multiple values, i.e. if there's more than one alias for the path, couldn't see a relevant function in the AliasManager for this.

*/
public function execute() {
$path = $this->getContextValue('path');
$alias = $this->aliasManager->getAliasByPath($path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need to load the alias? You can just pass the path as condition to the delete() method? That should delete all aliases for that path?

@stephenpurkiss
Copy link
Contributor Author

Why do you need to load the alias? - good question, it's my current blurred understanding of the changes from procedural to OO. It'll get there, I'm old, it takes longer to sink in these days :D Have removed references to aliasmanager and squashed the commit.


use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\rules\Plugin\Action\PathAliasDelete;
use Drupal\rules\Tests\RulesUnitTestBase;
Copy link
Collaborator

Choose a reason for hiding this comment

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

That file has been moved, that's why the tests are failing. Make sure to run the phunit tests locally.

@stephenpurkiss
Copy link
Contributor Author

Oops, I'd realised they'd been fixed but I thought for a moment my local 8.x-3.x branch was just out-of-date but wasn't. Fixed.

@stephenpurkiss
Copy link
Contributor Author

Right, think I've got it :D

klausi added a commit that referenced this pull request Sep 16, 2014
@klausi klausi merged commit b9331c1 into fago:8.x-3.x Sep 16, 2014
*
* @Action(
* id = "rules_path_aliases_delete",
* label = @Translation("Delete alias for a path"),
Copy link
Owner

Choose a reason for hiding this comment

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

Delete a path alias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants