Just opening up the conversation of porting this module to Drupal 8. Has there been any discussion or thoughts on the approach?

We'd be happy to help out. :-)

Kim

Comments

Dave Reid’s picture

We would need to get a planning session for update strategy. With a lot of the page rendering process changed, I am very worried about being able to output Metatags in the ways we expect to do so. As well as make sure to account for the newer D8 technologies like CMI.

anavarre’s picture

As Core is stabilizing a bit more nowadays, I wonder if it makes sense to start the discussion again?

DamienMcKenna’s picture

Category: Feature request » Task
Issue summary: View changes
Status: Active » Postponed

I don't recommend touching this until 8.0-beta1 is release, and I'm personally focusing on D7 for the foreseeable future.

If else anyone wants to work on this I'm happy to assist.

kim.pepper’s picture

OK great. I might set up a sandbox so we can start playing around with a port in there.

kim.pepper’s picture

Sandbox created here. https://drupal.org/sandbox/kimpepper/2175287

Let me know if you'd like write access.

Anonymous’s picture

Any updates on this?

kim.pepper’s picture

No. I've not spent any time on this in the last 6 months.

Any objections to using Github for the initial conversion efforts? It's been very useful for porting token and pathauto so far.

Dave Reid’s picture

I would request this is work is postponed until 8.0-beta1 is out and this module has reached the 1.0 release.

Anonymous’s picture

@dave - I think D8 has quite stable API already. Yes, sometimes minor changes are made but I haven't had a problem since december and I'm making a big distribution(and I have a big need for SEO module like this one).

anavarre’s picture

Status for D8 is 3 beta blockers left and Damien said earlier this week that 1.0 might soon be released (pending performance work in https://www.drupal.org/node/2307383 I guess)

It seems reasonable to wait just a big longer. We're talking about 1 month maybe.

rickmanelius’s picture

Dave mentioned in #8 that it would be useful to pause this until metatag-7.x-1.0 and drupal-8.0-beta1. Would this be an appropriate time to revisit this now that both milestones have been met?

DamienMcKenna’s picture

Title: Port metatag to Drupal 8 » Port Metatag to Drupal 8
Status: Postponed » Active

Indeed it would. Anyone want to work on this?

kim.pepper’s picture

/me raises hand.

Are we happy to do an initial conversion to D8, then do conversions to plugins and config entities as followups?

DamienMcKenna’s picture

@kim.pepper: I'd be completely satisfied with that - v1 as a "get it working" port, v2 as a "this is how it should work" cleanup.

kim.pepper’s picture

Hmm. This is going to be quite tricky.

I had a go at running drupalmoduleupgrader across it to pick up anything automated. Had very limited luck, and ran into some fatals.

I've made attempts at some simple function conversions in the metatag.install and metatag.module files.

Pushing my code up here https://github.com/kimpepper/metatag

Let me know if you'd like write access.

Kim

rickmanelius’s picture

Hi @kim.pepper. From the looks of it, the https://www.drupal.org/project/drupalmoduleupgrader module is still moving quickly to resolve a lot of open tickets, so it's possible that improvements coming down the pipeline might address the issues you were hitting in #15.

I'm not ready to dive in yet, but this module is on my wishlist as I'm starting to explore Drupal 8 a bit more. I'll let you know if it warrants gaining access (or just forking your copy outright).

DamienMcKenna’s picture

kim.pepper’s picture

@DamienMcKenna do you want to use yours as the primary repo to submit pull requests to?

DamienMcKenna’s picture

@kim.pepper: You don't have to (it's git after all) but it might make some things easier for you, e.g. keeping up with changes in the D7 codebase.

valthebald’s picture

wish I saw this topic earlier...
@kim.pepper: Have you done any work except for initial commit? Is it result of drupalmoduleupgrader?

I am working for some time on https://www.drupal.org/sandbox/valthebald/2339829, but of course, I'd prefer to join efforts with someone else, if the work is already in progress

DamienMcKenna’s picture

FYI just to mention it, I'm expecting to start getting involved in this sometime in January.

kim.pepper’s picture

@valthebald No, I haven't done much at all.

Happy to work with others around another repo.

Kim

valthebald’s picture

@DamienMcKenna/@kim.pepper, I have granted you commit permissions to the sandbox project.

If someone else is going to work on this, it would be probably a good idea to start opening issues, at least for the big tasks (i.e. converting meta tag configuration to D8 configuration entities)

DamienMcKenna’s picture

I'll be starting on this in the next week-or-two.

DamienMcKenna’s picture

Would anyone be interested in having a hangout / skype chat to discuss this within the next two weeks?

Dave Reid’s picture

I could in IRC.

mikey_p’s picture

IRC or hangout would be cool.

tsvenson’s picture

@DamienMcKenna *promoted* this on on Twitter just. I plan to use this module for a Drupal 8 project I'm about to startup now.

Will there be a need for supporting direct upgrading from a D7 site, or is that being easier to make now using Migrate in core?

rvilar’s picture

I'm interested too. For me is better IRC too

Anonymous’s picture

Hey Damien I am still pretty new to the Drupal 8 format for modules but I have been playing with it a bit. I would be happy to help out in any way I can. Let me know when you want to have the IRC and I will check it out. :)

jibran’s picture

IRC +1

valthebald’s picture

irc+1

a.milkovsky’s picture

As I see there are 2 repos for porting of the metatag module to Drupal 8:
1. https://github.com/kimpepper/metatag
2. https://www.drupal.org/sandbox/valthebald/2339829
And https://github.com/damienmckenna/metatag as well.

Which one will be used for development now?

P.S: irc +1

DamienMcKenna’s picture

FYI what I uploaded to github is a mirror of the main repo, and I also have one on bitbucket: https://bitbucket.org/DamienMcKenna/metatag

DamienMcKenna’s picture

Please select one of the times on the following event invite:

DamienMcKenna’s picture

So far it seems that either Monday the 16th or Tuesday the 17th between noon and 2pm EST (5pm to 7pm GMT) would work for more people than the other times, the difference currently comes down to whether valthebald or mikey_p could make it. I'll follow up tomorrow and will make a decision then.

DamienMcKenna’s picture

FYI I've changed the time options to only include when Dave Reid was available, please review the times and update your selection as appropriate. Thank you.

valthebald’s picture

I can make it both on 16th and 17th on suggested hours (will update doodle now)

DamienMcKenna’s picture

Ok, thank you all for letting me know when would work best for you. Based on the submissions I've picked this coming Monday, February 16th between noon and 2pm EST, i.e. between 5pm and 7pm GMT; you can download an icalendar file to add it to your calendar.

Lets plan to meet in the #drupal-seo channel on Freenode IRC.

DamienMcKenna’s picture

DamienMcKenna’s picture

Issue tags: +D8CX
DamienMcKenna’s picture

Issue tags: +Drupal 8.x
DamienMcKenna’s picture

I discovered that when drupal_set_title() was removed it was no longer possible to arbitrarily set the page title from a page a module does not control; we'll need to resolve #2121123: Introduce Drupal::formatTitle() as a replacement for drupal_set_title.

DamienMcKenna’s picture

Another one: hook_page_build() was removed so we'll have to use either hook_page_attachments() or hook_page_attachments_alter(). Hopefully.

Berdir’s picture

hook_page_attachments() should work fine for everything that uses #attached, yes, that's the only thing it can do. (and yes, html_head elements can be added through that, although the API is a bit strange)

DamienMcKenna’s picture

FYI I've made a rough alpha-grade copy available:

It doesn't do much, and there are a few todo items that we'll be dealing with early next week to fix some items, but it's a step in the right direction. Right now it *only* supports entities, check the README.txt file for the full todo list.

DamienMcKenna’s picture

The D8 codebase is now able to output the page title, and has a number of other improvements since last week. Please feel free to poke it with a stick.

Anonymous’s picture

The only thing I was able to do was attach the field. I couldn't finish configuring it because if yo uvisit the field settings page the browser will abort the request. The same goes for displaying an entity form with attached field. Seems like issue with plugin implementation/invokation.

DamienMcKenna’s picture

@ivanjaros: I wasn't able to replicate that problem using 8.0.0-beta9.

Anonymous’s picture

I have the same problem with following error in the log

PHP Fatal error: Class 'Drupal\\metatag\\Plugin\\metatag\\Tag\\MetaNameBase' not found in /var/www/docroot/modules/metatag_d8/src/Plugin/metatag/Tag/Title.php on line 25

Changing the name MetaTagBase in MetaNameBase.php to MetaNameBase fixes this issue.

Which repo is the main one to fork and do PR for?

I used Drupal 8-beta.9 and https://bitbucket.org/DamienMcKenna/metatag_d8

DamienMcKenna’s picture

Apologies, there were some changes I had forgotten to upload to that repo. Please grab the latest and it should work.

Anonymous’s picture

Is there any JSON serialization of the metatag values?

DamienMcKenna’s picture

@vincic: Not currently.

Anonymous’s picture

This commit https://bitbucket.org/sashav/metatag_d8/commits/e037624517aa111242f9f864... lets the tags be serialized to JSON.

This works as quick hack but I am not sure if I am on the right track. Didn't find any good documentation or examples how it should be.

DamienMcKenna’s picture

FYI I've uploaded some changes that fix two problems - Google+'s namespaces was throwing an error, and it was stomping all over any other module that needed to add page attachments.

Anonymous’s picture

With Drupal 8 Beta 11 I get

PHP Fatal error: Cannot access protected property Drupal\\field\\Entity\\FieldConfig::$field_name in /var/www/docroot/modules/metatag/src/MetatagManager.php on line 236

Anyone working on this?
I have a fix in https://bitbucket.org/DamienMcKenna/metatag_d8/pull-request/2/use-method...

Anonymous’s picture

Small fix to ensure Matatags are only applied for objects implementin ContentEntityInterface.

Solves problems with adding a Solr server.

https://bitbucket.org/DamienMcKenna/metatag_d8/pull-request/3/metatagman...

Any feedback on the PR I have made?

Anonymous’s picture

I know that developing is easier on GitHub or Bitbucket but can someone please put the dev version in here too so more people can test it as dev module?

Anonymous’s picture

I see the last commit to Bitbucket repo was over 3 months ago. Is there a github repo or is this the only repo where the work is being done?

DamienMcKenna’s picture

I'm hoping to get to it later today to merge in some of the fixes that didn't (evidently) make it to the bitbucket repo, otherwise it'll be tomorrow morning. There hasn't been any further work (yet) but there have been some fixes. Also a few people have uploaded PRs on bitbucket, I'll look to reviewing & merging them.

rakesh.gectcr’s picture

@DamienMcKenna

Can you please keep the dev version here.

So that we can test help to improve speed of the development

DamienMcKenna’s picture

I've uploaded the current codebase to the 8.x-1.x repository and am going to build out a list of issues to cover my current plans for the module. Assistance would be appreciated :)

DamienMcKenna’s picture

I've put together some planning issues for the roadmap to 1.0 and beyond, starting with beta1: #2563605: Plan for Metatag 8.x-1.0-beta1 release

I've fleshed out a bunch of tasks that need to be done, with most of them assigned to a specific release plan.

DamienMcKenna’s picture

I've also added a Trello board, if you'd like to see the plans on a kanban board: https://trello.com/b/V57H51X5/metatag-d8

Anonymous’s picture

That trello roadmap looks to me like it has too many unnecessary issues. I would prefer to have a simple stable release ASAP and add features afterwards so it would not prevent people from using the simple features right away.

platinum1’s picture

I think post #65 has a lot of merit.

jibran’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
DamienMcKenna’s picture

I've ported over two PRs provided by people on the old bitbucket repository, one from vincic and another from k9kiko, and another had been fixed in the original codebase already.

I've deleted the bitbucket repository in favor of the one here, but I have made the codebase available on github and bitbucket for people who would prefer to do PRs that upload patches:

All changes will be added to the repository via d.o and then pushed out to the others. Any PRs uploaded to either Bitbucket or GitHub will be replicated as issues on d.o and then handled from there.

DamienMcKenna’s picture

@ivanjros: Please consider what functionality is available for D7, then review the list of tasks for 1.0-beta1 through 1.0, and let me know which ones you don't think ought to be in 1.0.

Anonymous’s picture

Backlog: the only one that makes sense to me is the per-path configuration. Migration is good to have but I don't see a reason why it should block the release at this point. It can be added later IMHO.

Beta 1: console integration seems unnecessary at this point.

Beta 2: I'm not sure. I'm not SEO expert. At this point all I need is simple page title, description and keywords(some people just still think they are relevant).

The rest is fine.

I think, in regard to Beta 2, that most people coming from D6/D7 will expect just what the older modules provided and those were just those simplest things that I listed for Beta 2. But that is just my opinion.

DamienMcKenna’s picture

@ivanjaros: The DrupalConsole integration will make it possible to generate new meta tags with a single command. I'm not releasing Metatag on D8 without it supporting the meta tags that are on D7, which the DrupalConsole will make a lot easier to do. And people who still think the "keywords" meta tag is relevant but don't know about Open Graph and Twitter Cards need to catch up on the last fifteen years of SEO practices.

FYI the backlog is things that I'm not planning on working on until after 1.2.

Just to make it clear - the items I've planned out indicate the order that I'm planning on approaching tasks, but if anyone wants to work on something and upload a patch I'd be extremely grateful.

rakesh.gectcr’s picture

+1
(cheers)

alex0412’s picture

Hey guys,

I've tried to use the Drupal 8 Version of this module and noticed that if you add a Open Graph Image URL like "http://somesite.com/image.jpg" it gets changed to "http:/somesite.com/image.jpg" in the html preprocess step.

Responsible for that is this bit of code in src/MetatagToken.php:

65 // Ensure that there are no double-slash sequences due to empty token values.
66 $replaced = preg_replace('/\/+/', '/', $replaced);

Can someone please explain why double slashes are being removed? I don't really understand what the comment means.

Thanks!

DamienMcKenna’s picture

@alex0412: Please open a bug report for that.

Anonymous’s picture

I tried the dev version(last commit few days ago) and it crashes on \Drupal\metatag\MetatagManager::groupDefinitions() since the group and tag plugin manager services have some weird definition without any arguments in services file and so instead of group stuff the manager provides entity definitions.

DamienMcKenna’s picture

FYI we're currently working against beta15 right now, please keep that in mind while testing. That said, if you find a bug please open a new issue for it. Thanks!

larowlan’s picture

My 2c - I'd put tests first, but that's just how I work. Adding them as an afterthought in RC1 may lead to regressions - adding them as functionality is ported will lead to improved stability.

Happy to help esp. with tests.

jibran’s picture

++ on tests. Happy to review the tests as well. I think @Sam152 can also help with tests I have seen him using a very good base class with metatag assertions.

DamienMcKenna’s picture

I'd *really* appreciate patches for tests, please add them to #2563637: Write tests for the 8.x-1.x functionality. Thanks!

DamienMcKenna’s picture

Status: Active » Fixed

I've released beta1: https://www.drupal.org/node/2563605

Lets continue all further work in separate issues.

Thank you all for your patience and help!

DamienMcKenna’s picture

(the package is being built, please give it a little while to finish)

rakesh.gectcr’s picture

@DamienMcKenna Wonderful thanks!

gbyte’s picture

Thanks for porting this important SEO module. I am still getting the test phone number field in metatag settings, what's up with that - missing something? :)

BTW regarding D8 SEO, for some xml sitempa love, check out simple xml sitemap..

agoradesign’s picture

@gbyte.co: meta tags are fields now. The test phone number seems to be a placeholder for a global settings page

DamienMcKenna’s picture

LOL, yes, that was a placeholder page we just haven't used yet.

gbyte’s picture

@agoradesign: How would I go about setting global metatags / abstract as it was possible in the D7 version? Or is this feature not ported yet?

DamienMcKenna’s picture

@gbyte.co: That part isn't done yet, it'll be handled in #2563639: Global configuration via config entities.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

darol100’s picture

You guys should remove ..

"#D8CX: while there was initial work on porting metatags quick to Drupal 8, I encourage everyone who would like to help, join the effort with #2052441: Port Metatag to Drupal 8"

from the project page.

DamienMcKenna’s picture

@darol100: That text isn't on the project page?

darol100’s picture

Wrong issue queue.... My bad... #90 was for meta tag quick.

jwilson3’s picture

Hiya Damein,

Congrats on migration of this important module.

Wasn't sure if this should have been a separate ticket or not, but I was just browsing the 8.x codebase and see metatags_panels is no longer around. What is the story there?

Also, other than the feature list on the project page, is there a document somewhere that talks about the differences between D7 and D8, and/or roadmap or features that will not be ported or features that are just no longer needed?

Thanks man.
James

Edit: I'll be happy to turn these into two separate questions on the issue queue if you'd prefer.

DamienMcKenna’s picture

Hey there @jwilson3. Thanks for the comment.

Panels integration: #2563657: Panels / Page Manager integration
Comparison document: good idea, I've opened #2923406: Document the differences between D7, D8 versions

jwilson3’s picture

Awesome! Thanks for super fast response. 🎉

I'm still putting together a site audit for d7-d8 upgrade, when we get to implementation, will try to test the panels patch!