Comments

jadhavdevendra created an issue. See original summary.

gremy’s picture

StatusFileSize
new3.25 KB

Here is a patch to convert usage of Drupal::state to config.

gremy’s picture

Status: Active » Needs review
hawkeye.twolf’s picture

Looks great! Thanks Gremy.

jadhavdevendra’s picture

I get this error after applying the patch.
Recoverable fatal error: Object of class Drupal\Core\Field\EntityReferenceFieldItemList could not be converted to string in node_title_help_text_form_node_form_alter() (line 21 of modules/node_title_help_text/node_title_help_text.module

hawkeye.twolf’s picture

Yup, same here, thanks for the report @jadhavdevendra. I think @gremy is working on addressing it.

rolodmonkey’s picture

Just a note, it looks like this patch would simply abandon the existing settings and leave them in the DB.

Since the D8 version of this module doesn't have a stable release, that is technically allowed. But, I wonder how hard it would be to provide an update hook that migrates the settings?

gremy’s picture

StatusFileSize
new3.54 KB

Sorry. I updated the code and now it's way better.
There were more problems with configuration not boing imported.
After more research the recommended method is to use "getThirdPartySetting" and "setThirdPartySetting".

Here is an updated version using ThirdPartySettingsInterface.

gremy’s picture

@RoloDMonkey as you said, since this is a DEV version, and there is no stable, alpha or beta release for D8 an update hook is not required.

gremy’s picture

StatusFileSize
new4.79 KB

To prevent loss of configuration for sites that had the States config version I made added an update hook.
I also updated hook_uninstall.

hawkeye.twolf’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.79 KB

Works like a charm! Uploading a new version that fixes Coder issues in the patch, and marking RTBC.

jadhavdevendra’s picture

Status: Reviewed & tested by the community » Needs work

I am getting following error while saving the help text for default article content type.
Recoverable fatal error: Argument 2 passed to node_title_help_text_form_node_type_form_builder() must be an instance of NodeTypeInterface, instance of Drupal\node\Entity\NodeType given in node_title_help_text_form_node_type_form_builder() (line 59 of modules/node_title_help_text/node_title_help_text.module).

hawkeye.twolf’s picture

Ah, hmmm. @jadhavdevendra, what version of Drupal 8 are you running? I tested on 8.3.5.

jadhavdevendra’s picture

Me too using 8.3.5. I have sent you a message with access details to test environment.

hawkeye.twolf’s picture

@jadhavdevendra, yowsers! Thanks for the link and creds to your environment, I see the error you're talking about. Investigating further...

hawkeye.twolf’s picture

StatusFileSize
new392 bytes
new5 KB

Found it :) A missing use statement at the top. See attached interdiff.txt. That was my bad for not doing proper QA. I didn't actually try saving the form, I just saw that the settings provided by @gremy deployed correctly in our project environment. I'm guessing he must have set the config value programmatically / manually, 'cause the form save couldn't have worked for him either.

Anywho, please give it another go @jadhavdevendra and let us know. Thanks! :)

hawkeye.twolf’s picture

sinn’s picture

#16 works good

hawkeye.twolf’s picture

Status: Needs work » Reviewed & tested by the community

jadhavdevendra’s picture

Status: Reviewed & tested by the community » Fixed

Fixed and created 8.x-1.0 release.

Status: Fixed » Closed (fixed)

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