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

AliasType plugins #15

Merged
merged 12 commits into from
Oct 22, 2014
Merged

AliasType plugins #15

merged 12 commits into from
Oct 22, 2014

Conversation

kimpepper
Copy link

No description provided.

@davereid
Copy link

davereid commented Sep 2, 2014

We'll want a generic ContentEntityAliasType instead of NodeAliasType

/**
* Provides an interface for pathauto alias types.
*/
interface AliasTypeInterface {
Copy link
Member

Choose a reason for hiding this comment

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

I guess this should then extend PluginConfigurableInterface and PluginFormInterface.

@kimpepper kimpepper changed the title Create initial interface and annotation AliasType plugins Sep 5, 2014
* The module handler to invoke the alter hook with.
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/AliasType', $namespaces, $module_handler, 'Drupal\pathauto\Annotation\AliasType');
Copy link
Member

Choose a reason for hiding this comment

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

I think we should include the module name in the path here, Plugin/pathauto/AliasType probably.

Copy link
Author

Choose a reason for hiding this comment

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

OK. Forgot we're not in core anymore. :-)

@davereid
Copy link

davereid commented Sep 5, 2014

So interesting to note that I think that the actual configuration form should be Pathauto pattern config entities, not forms provided by the AliasType plugin. We want to get far away from having a 'giant screen of pattern inputs' - see https://www.drupal.org/node/273104#comment-2452322

@davereid
Copy link

davereid commented Sep 5, 2014

I wonder if we could also use derivatives for not only all the entity types, but all the bundles, and then translated language as well

@Berdir
Copy link
Member

Berdir commented Sep 5, 2014

So interesting to note that I think that the actual configuration form should be Pathauto pattern config entities, not forms provided by the AliasType plugin

I don't understand this.

I want to clarify that all I want to do here is replace the existing hook by using plugins. If we want to completely plugify the whole module, this issue will never be done. I don't expect a perfect solution, just some that is at least as good as what is there now (which shouldn't be too hard ;)).

@davereid
Copy link

davereid commented Sep 5, 2014

The forms for patterns should not be in these plugins. They should be config entities.

@davereid
Copy link

davereid commented Sep 5, 2014

Hrm, I guess the plugin could have the configuration form for the pattern, but it should be one pattern form in the plugin, and not a lot of patterns, since we'd be using derivatives for those.

@kimpepper kimpepper force-pushed the alias-type-plugins branch 2 times, most recently from 1aae253 to a2db9a4 Compare October 2, 2014 07:33
@Berdir Berdir mentioned this pull request Oct 3, 2014
* The module handler to invoke the alter hook with.
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/pathauto/AliasType', $namespaces, $module_handler, 'Drupal\pathauto\Annotation\AliasType');
Copy link
Member

Choose a reason for hiding this comment

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

The arguments here changed, parent now expects an interface before the annotation class.

@Berdir
Copy link
Member

Berdir commented Oct 20, 2014

Reviewed. Likely next steps:

  1. Add the other hook implementations to plugin classes. Separate for now.
  2. Add a method for batch_update_callback, possibly an optional separate interface as not all types might support this.
  3. Then start to actually use this and kill pathauto.pathauto.inc.

* The token types.
*/
public function getTokenTypes();
}

Choose a reason for hiding this comment

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

nitpick: missing blank line before }

@kimpepper
Copy link
Author

later on could this go in a dialog?

Sure.

Reviewed.

Great. Are you ok to merge? This only adds new classes, and shouldn't be swapping out existing implementations (yet).

@Berdir
Copy link
Member

Berdir commented Oct 22, 2014

Hm. Not sure about merging it like this already, or if we should continue a bit to see if it actually works. But i guess we can change it just as easily in later pull requests as we would here. Ok then ;)

Berdir added a commit that referenced this pull request Oct 22, 2014
Added AliasType plugins with first implementation for node.
@Berdir Berdir merged commit b1bb087 into md-systems:8.x-1.x Oct 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants