Hi,
Is there plans to introduce D8 version of this module?
We (@InternetDevels team) would like to help you with development of this version.
Thanks, @ipo4ka704 and (@Rumato).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

I guess noone yet considered to work on a new version but it is certainly worth to think about it.

Drupal 8 might offer enough metadata to have a proper integration into title/body and all kind of other fields without additional effort.

ipo4ka704’s picture

Thanks for reply. Ok, I got it. If there are plans to introduce D8 version of this module, please notify as.

vasi1186’s picture

I created a branch for D8, and start working on it at Drupal Dev Days Szeged.

  • Commit 9650308 on 8.x-1.x by vasi1186:
    #2220169 : migrated the field edit form.
    
ebeyrent’s picture

Can you please make a dev release so people can start testing?

frjo’s picture

I have created a 8.x-1.x release now, it will show up as soon as the build scripts on d.o. have done their bit.

ebeyrent’s picture

I don't see a D8 release yet - do you have to enable it?

frjo’s picture

I have enabled it to display on the project page now, it was only listed on the releases page before.

breta’s picture

Here is patch for 7.x-3.x version of Maxlength. This patch updating all files to be compatible with drupal 8.

gvso’s picture

Hi @breta, thanks for the path but the patch didn't apply to me, even if you do it with simplytest.me, you will get an error

However I also noticed these ones

  1. +Originaly inspired by functionality found in the ed_classified module.
    +
    +Since branch 7.x-3.x comes uses the original code from maxlength_js.
    \ No newline at end of file
    -Since branch 7.x-3.x comes uses the original code from maxlength_js.
    +Since branch 7.x-3.x comes uses the original code from maxlength_js.
    \ No newline at end of file

    \No newline at end of file and maybe they will be unnecessary if this will be for D8


  2. -function maxlength_permission() {
    -  return array(
    -    'bypass maxlength' => array(
    -      'title' => t('Bypass maxlength setting'),
    -      'description' => t("If a maxlength is configured for a certain field, the user don't see the value."),
    -    ),
    -  );
    -}

    You removed the hook_permission() and didn't use an .permissions.yml instead


  3. function maxlength_help($path, $arg) {
       switch ($path) {
    -    case 'admin/help#maxlength':
    +    // Main module help for the maxlength module.
    +    case 'help.page.maxlength':

    This won't work



Please make the patch work.

breta’s picture

I add the permissions and now the help function works when I tested it on my computer. I tested applying patch too and it worked for me now.

naveenvalecha’s picture

Status: Active » Needs work

Awesome work!.Some fixes that needs reroll.

  1. +++ b/maxlength.info.yml
    @@ -0,0 +1,11 @@
    +# core: 8.x
    

    Seems you forgot to remove the #.

  2. +++ b/maxlength.info.yml
    @@ -0,0 +1,11 @@
    +
    +# Information added by Drupal.org packaging script on 2014-11-26
    +version: '8.x-1.x-dev'
    +core: '8.x'
    +project: 'maxlength'
    +datestamp: 1417023230
    

    This is automatically added by drupal.org packaging script.So its not needed.SImply remove it.

  3. +++ b/maxlength.module
    @@ -1,10 +1,17 @@
    +?php
    

    @typo here.
    <?php

  4. +++ b/maxlength.permissions.yml
    @@ -0,0 +1,3 @@
    \ No newline at end of file
    

    Just add the line at the EOF in next reroll.

  5. +++ b/src/Tests/MaxlengthTest.php
    @@ -0,0 +1,98 @@
    +  ¶
    

    little code sniffer issue.

  6. +++ b/src/Tests/MaxlengthTest.php
    @@ -0,0 +1,98 @@
    \ No newline at end of file
    

    Just add the line in the next reroll.

naveenvalecha’s picture

Version: 7.x-3.0-beta1 » 8.x-1.x-dev

Changed the version.
Also remove the license.txt it is automatically added by the drupal.org packaging script.

webiator GmbH’s picture

Is anyone currently working on this?
In order to make this work we have to keep this in mind https://www.drupal.org/node/2225801

dawehner’s picture

@brutzelspeck
If you want to work on it, feel free to ping me and get maintainer permissions ...

vasi1186’s picture

I started again to work on it.

I replaced the hook_field_attach_form() with hook_field_widget_form_alter().

Francewhoa’s picture

We would be happy to contribute testing patch, quality assurance, documentation, and agile project management services if needed

Any additional volunteers to port Maxlength module from Drupal 7 to 8?

Related pages

Francewhoa’s picture

Title: Drupal 8.x » Port Maxlength to Drupal 8
Issue tags: +Drupal 8

I updated this ticket title so it's easier to find with aggregators and search engines

Francewhoa’s picture

That related ticket shows the D8 porting status on the module project page under "Recommended releases" section at https://www.drupal.org/project/maxlength

Which invites additional contributors to join the efforts

Details at https://www.drupal.org/project/contrib_tracker

Anonymous’s picture

We need the maxlength modul in our project. We had to port them. This patch make the module working with the D8 Version. It's not full ported but you can use the basic function including executing the nessesary javascripts to show the countdown.

The patch based on the last D8 dev version.

dawehner’s picture

@Almare
Ideally patches are created via GIT, so stuff like the LICENSE.txt or changed info.yml files aren't committed as well.

tannerjfco’s picture

FileSize
14.56 KB

The patch in #20 couldn't apply to either dev release or git, so here's a re-roll

  • frjo committed c96f441 on 8.x-1.x authored by tannerjfco
    Issue #2220169 by breta, tannerjfco, Almare: Port Maxlength to Drupal 8
    
frjo’s picture

Status: Needs work » Fixed

Committed #22 to 8.x-1.x, thanks for working on this!

Status: Fixed » Closed (fixed)

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

mordonez’s picture

After install maxlength module from d8 branch i've get the following error at admin/structure/types/manage/page/form-display:

[Sat Mar 05 00:22:52 2016] [error] [client 127.0.0.1] Recoverable fatal error: Argument 1 passed to maxlength_field_widget_third_party_settings_form() must be an instance of WidgetInterface, instance of Drupal\\Core\\Field\\Plugin\\Field\\FieldWidget\\StringTextfieldWidget given in /Users/mordonez/Sites/d8/modules/custom/maxlength/maxlength.module on line 65

I'd take a chance to share a patch that i done to get maxlength running on D8. I have taken the liberty to do some changes for myself:

- I've removed title code because now is a field.
- I've removed the settings of truncate html (because is not ported yet)
- I've removed the settings of summary (because is not ported yet)
- Removed tinymce code (ckeditor in core).
- Added the library

Any comments are welcome.

Michèle’s picture

@mordonez
thank you very much for this patch! I had a similar error in conjunction with the Paragraphs module (see this issue). Your patch has resolved the problem. :-)

mordonez’s picture

Here another version porting truncate and summary.

I've deleted schema files, because i think is not necessary when uses hook_field_widget_third_party_settings_form or i didn't found the way to do it..

mordonez’s picture

Status: Closed (fixed) » Needs review
mordonez’s picture

I've changed the status to review, but i don't know if i can change it from a closed (fixed) issue or I need to create another issue to porting the module.

Anonymous’s picture

I tested your patch mordonez from #28 and it works as expected.

@tannerjfco thx for the reroll.

  • dawehner committed 05bb368 on 8.x-1.x authored by mordonez
    Issue #2220169 by mordonez, breta, Almare, tannerjfco: Port Maxlength to...
dawehner’s picture

Status: Needs review » Fixed

People use that patch in production, so yeah let's get it in. We can refine the Drupal 8 version more, this is for sure. Thank you for the patch. Committed and pushed

Please open new issues for other problems. Thank you!

Status: Fixed » Closed (fixed)

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