Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#2 | auto_nodetitle-portingD8Beta12-2380433-2.patch | 14.64 KB | jmoreira |
Comments
Comment #1
Matt V. CreditAttribution: Matt V. commentedI haven't tested it myself, but there appears to have been some work done towards a Drupal 8 version and there is an 8.x-1.x branch.
Comment #2
jmoreira CreditAttribution: jmoreira at Acquia commentedHey guys,
I worked today in a version for this module for Drupal 8-beta12.
The only functionality missing is operations. I also plan to write some tests for this module if I have time.
I also created a repo on Github for this(https://github.com/jose-oliveira/auto_nodetitle), though I'm not sure if it's necessary.
Disclamer:
Though I've been working with Drupal for over 4 years, this is my first time actually contributing code to d.o., so forgive me if I'm not doing this right and feel free to teach me the right way. =D
Comment #3
jmoreira CreditAttribution: jmoreira at Acquia commentedPlease ignore this patch and see next comment.
Comment #4
jmoreira CreditAttribution: jmoreira at Acquia commentedHere's a patch with the operations functionality. To make this work I also had to create an "Utility" class with the title generation functionality.
Comment #5
webchickIndicating that there's a patch here ready for review. Thanks for the work on this!
Comment #6
smerth CreditAttribution: smerth as a volunteer commentedI downloaded the module from https://github.com/jose-oliveira/auto_nodetitle. I tried to applied the patches but they had already been applied the GitHub module. Any way everything seems to work fine for the title of a content type using tokens and a random hash, both for filling in the title and hiding and for filling in a blank title. But I found the module fails to interact with inline_entity_form. I submitted a separate issue for that.
Comment #7
Kristen PolComment #8
klokie CreditAttribution: klokie as a volunteer commentedComment #9
Adams Latif CreditAttribution: Adams Latif commentedPlease I will much grateful if you could work on the auto_nodetitle porting to drupal 8
I need it to complete my project please.
Comment #10
juliencarnot CreditAttribution: juliencarnot commentedHi all and thanks a lot for your work on this module!
I learned about this module the hard way, by hiding the Title field in the form display tab of a fairly complex content type, then submitting the form and meeting a blank page and the following message in the log:
Could not find a way to display the title field again, and I guess D8 should not allow to hide it if it can't deal with a blank title, but I havent found a bug report on core yet, maybe I should file one...
Anyway, I took the code from the github 8.x-1.x branch today and it installed perfectly. I did not install the token module and then went to a new content type I've set and chose to hide the Title field and left the pattern field "blank for using the per default generated title", which I though would be good enough for now. I saved the config and went back to the form, but when submitting it, I get a nice red alert message "This value should not be null. ". I went back to the config and tried to use the "Automatically generate the title if the title field is left empty" setting and have the same error when I leave the field empty.
Adding some content in the pattern box such as abc, [token] or
<?php return "Author: $node->name"; ?>
and checking the php evaluation did not change anything, same error.Is there something I'm doing wrong?
Comment #11
juliencarnot CreditAttribution: juliencarnot commentedHi all,
I installed Tokens and gave it a try with the two different options (hiding title or not), with node-related tokens or with the random number token, on a custom content type or on the default "article" type, but I still have the red alert message "This value should not be null. " when creating or modifying a node. The "update automatic nodetitles" on /admin/content gives no error but no change is made to the titles.
In the log, I see this message:
Location http://***/admin/structure/types/manage/article
Referrer http://***/admin/structure/types
Message Notice: Undefined offset: 1 in Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies() (line 58 of /var/www/html/core/lib/Drupal/Core/Asset/LibraryDependencyResolver.php).
I also occasionally see this one:
Location https://***/admin/structure/types/manage/resource
Referrer https://***/admin/structure/types
Message User warning: The following theme is missing from the file system: auto_nodetitle.auto_node_title in drupal_get_filename() (line 231 of /var/www/html/core/includes/bootstrap.inc).
I'd be grateful if anybody can give me a hint on these... I guess I should open new issues for this problem, but there is no 8.x version to tag them with... Thanks!
Comment #12
nflowers1228 CreditAttribution: nflowers1228 commentedI have the same issue as #10 I have attached screenshots
Name added to field with error message
How I configured Automatic Nodetitles - doesn't seem to be recognizing that the title field doesn't need to display
Comment #13
bdimaggioHey all - I have been playing with this a bit. Danielbeeke's pull requests on the Github repo address the problem described in #10 and #12, where the title field still is required when it shouldn't be. jmoreira, can you review and commit the pull requests? If not, I'm happy to pitch in, if you want to make me a collaborator on the repo. Thanks!
Comment #14
juliencarnot CreditAttribution: juliencarnot commentedThanks for the notice @bdimaggio!
I checked the pull requests (replaced my auto_nodetitle module folder with the zip from Danielbeeke's repo, enabled auto_nodetitle and cleared the cache).
On the article content-type, I can now save a new article without the title. If leave the pattern empty, I have this warning:
If I enter a token, there's no error message on the screen but the log still shows this:
On my custom content type, I still have the same problem, using either the second or third option: can't save a new node, the message is still "This value should not be null.", with or without a token.
I get the same error in the log:
Now I'm wondering if I should use this issue or open a new one on the original github repo or the pull-request one! ;)
Comment #15
juliencarnot CreditAttribution: juliencarnot commentedOK, my last problem was with my custom content-type: it had a core.base_field_override.node..title set (don't remember setting that myself, might be from a previous version but who knows!), with a line "required: true", whereas my other content-types where auto_nodetitle worked had "required: false".
If anybody else is affected, you can check /admin/config/development/configuration/single/export and select Base field override or edit it directly with drush config-edit, find number for core.base_field_override.node..title and set required to false.
Would be great if a maintainer could make a dev release including Danielbeeke's pull requests on the Github repo for further testing, looks like it's pretty close to a releasable stage!
Comment #16
jpshayes CreditAttribution: jpshayes commentedIs this branch up to date or do I need to patch with all the patches in this thread?
Comment #17
bdimaggio@jpshayes, I'd use the github repo, being sure to apply those pull requests from DanielBeelke. The stuff on http://cgit.drupalcode.org/ looks old to me.
Comment #18
spacereactor CreditAttribution: spacereactor commented@bdimaggio i using the repo with DanielBeelke, Automatic Nodetitle work but token broswer is missing as shown at #12 and there a error log everytime you at content type edit page.
Theme hook token_tree not found.
Comment #19
gaurav.goyal CreditAttribution: gaurav.goyal at Innoraft commentedHi.
I have fixed the issue of token not available and generate a Pull Request. In the code we were using token_tree, and the according to this issue #2640138: Use token_tree_link instead of token_tree to render links , token_tree_link is used instead of token_tree.
Comment #20
gaurav.goyal CreditAttribution: gaurav.goyal at Innoraft commentedForgot to attach image. Attached is the screenshot of configurations.
Comment #21
juliencarnot CreditAttribution: juliencarnot commentedThanks @gaurav.goyal, your PR works well for me. No more token_tree not found errors and the tokens list works. I was surprised that it didn't include the [node:...fields....] tokens to set the title from fields filled when creating a node, but these tokens still work if entered manually.
I'm also still affected by the required setting in core.base_field_override.type.title (see my workaround at #15).
Comment #22
gaurav.goyal CreditAttribution: gaurav.goyal at Innoraft commentedHi juliencarnot,
I tried to replicate the problem, but was unable to replicate it. I am not sure whether this is still an issue or not. For me everything was working as expected. It would be great if you can provide me the steps so that I can replicate it.
Comment #23
spacereactor CreditAttribution: spacereactor commentedThank gaurav.goyal for the token_tree_link but the node token are missing from the browser, example [node:content-type] but anyway autotitle still work with node token even it it not in the token browse list.
Got another question, I thought drupal 8 doesn't support php code insert for security reason.
Comment #24
Smith76 CreditAttribution: Smith76 commentedThis release works well.
However, it does not support "Inline entity form".
Is there a planned integration of this module ?
Comment #25
charos CreditAttribution: charos commentedSince the module is working , is there going to be an alpha release one the projects branch?
Comment #26
Sutharsan CreditAttribution: Sutharsan commentedI have forked jose oliveira's github repo to fix the some errors. Pull requests are pending but no reply from him Jose yet. Feel free to use my repo: https://github.com/sutharsan/auto_nodetitle/tree/8.x-1.x
If it helps, I can co-maintain the module to create a D8 release.
Comment #27
juliencarnot CreditAttribution: juliencarnot commentedThanks Sutharsan! Following your link, I see "This branch is even with jose-oliveira:8.x-1.x.", so I grabbed the last modified branch, "auto-title-service" and replaced the files on my install (8.04, lagging behind!), but I get this error on the create node page:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "auto_nodetitle.auto_title". in Drupal\Component\DependencyInjection\Container->get() (line 161 of core/lib/Drupal/Component/DependencyInjection/Container.php).
It would be great to have a D8 release, being so close to a fully functional state for this port... I haven't seen any replies from the maintainers in the lasts months, should we follow the steps for abandoned projects so that this release can be pushed out?
Comment #28
Sutharsan CreditAttribution: Sutharsan commented@juliencarnot, I know the abandoned module procedure. But I prefer the 'front door' first. I have sent a DM to bless with a request for co-maintainer ship.
For a full picture of my works in the repo, you should combine all branches. Further there is no upgrade path, but I think rebuilding the cache should be enough.
Comment #29
mlncn CreditAttribution: mlncn at Agaric for MASS Design Group commentedhttps://github.com/jose-oliveira/auto_nodetitle/tree/8.x-1.x worked for us. But instead of using an unsupported module we replaced it with:
:-)
Comment #30
Lowell CreditAttribution: Lowell as a volunteer commentedComment #31
Lowell CreditAttribution: Lowell as a volunteer commentedHadn't noticed this thread, seems a duplicate of here https://www.drupal.org/node/2608660#comment-11049271
We didn't mean to duplicate effort, this version is based on a fork of the jose-oliveira/auto-nodetitle branch and includes token support and a composer.json file so that it can be used as-is with the following composer command after adding this snippet to your site's composer.json repositories key.
composer require drupal/auto_nodetitle:dev-8.x-1.x
Hoping we can get any of these drupal 8 versions onto drupal.org
Comment #32
Sutharsan CreditAttribution: Sutharsan commentedI sent an email to both (co-)maintainers of the module, but got no reply. Looking at the state of the issue queue, this module looks to be un-maintained. Starting the abandoned module procedure as @juliencarnot suggested, will result in me taking over a module a badly maintained module. An I don't want that, I have plenty of contribution obligations already.
I plan to take a different route. I will start the Auto Title project. That will contain a Drupal 8 branch (only) and will support all entities and not just nodes. Development already started at: https://github.com/Sutharsan/auto_nodetitle/tree/auto-title-module[Edit]: Plan changed.
Comment #33
Sutharsan CreditAttribution: Sutharsan commentedI found the Automatic Entity Label project.
Comment #34
Lowell CreditAttribution: Lowell as a volunteer commentedNice find :-) https://www.drupal.org/project/auto_entitylabel
Comment #35
webchickSo should we mark this as a duplicate of #2613810: [auto_entitylabel] Automatic Entity Label?
Comment #36
Sutharsan CreditAttribution: Sutharsan commentedTechnically, yes. But not sure it will bring us closer to a solution. I had a look at the code, auto_entitylabel 8.x is in pretty bad shape. Created two issues, now see how (if) the maintainers respond.
Comment #37
guttenbergovitz CreditAttribution: guttenbergovitz as a volunteer commentedI have to confirm the solution mentioned in #15 actually solves the problem of required node label. Had to drush cex, modify core.base_field_override.node.[nodename].title.yml drush cim to force it over current installation and use the option of hiding titlefield and overwriting it.
---
It actually did the trick. Token replacement using [node:field_fieldname] do work just fine.
---
As for auto_entitylabes » no luck with the same approach.
Comment #38
Lukas von Blarer@Sutharsan I am currently using you auto_title branch. Works perfectly until now. Would you want to release this project since the maintainers of both projects are unresponsive?
Comment #39
Sutharsan CreditAttribution: Sutharsan commentedA maintainer of Auto Entity Label did respond and was interested in collaboration: #2659636-5: [Meta] D8 Port of Automatic Entity Label (AEL) Module I'm not keen on creating a third module with similar functionality. If you can't wait, feel free to use the code.
Comment #40
jeromerenders CreditAttribution: jeromerenders commentedThis module works great with content types, but doesn't with terms title in Taxonomy (which is what I'm looking for).
Sorry if it's not the place to talk about this, I'm fairly new to Drupal development and I just can't find the module that automatically fill the term title with the concatenation of other term fields.
Comment #41
isimgt CreditAttribution: isimgt commentedI have a error in the node form:
Recoverable fatal error: Argument 2 passed to Drupal\auto_title\EntityDecorator::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, instance of Drupal\webprofiler\Entity\EntityManagerWrapper given, called in /core/lib/Drupal/Component/DependencyInjection/Container.php on line 276 and defined en Drupal\auto_title\EntityDecorator->__construct() (line 64 modules/contrib/auto_nodetitle/src/EntityDecorator.php).
Comment #42
Stephen Ollman+1 https://www.drupal.org/project/auto_entitylabel
Does the job nicely.