Upgrade from 1.4 to 3.0 failure during update DB and colorpicker widget doesn't work after upgrade

Created on 15 May 2023, about 1 year ago
Updated 29 May 2023, about 1 year ago

Problem/Motivation

Hello.

I had tried to upgrade module Jquery Colorpicker from 1.4 to 3.0 version, but stopped on Fatal error during update DB:

wodby@php.container:/var/www/html $ drush cr
 [success] Cache rebuild complete.
wodby@php.container:/var/www/html $ drush updb
 -------------------- ----------- --------------- --------------------------------------------------------------------------------------------------- 
  Module               Update ID   Type            Description                                                                                        
 -------------------- ----------- --------------- --------------------------------------------------------------------------------------------------- 
  jquery_colorpicker   8200        hook_update_n   Updates the Jquery Colorpicker module from 8.x-1.x to 8.x-2.x.   Version 8.x-2.x of the module     
                                                   changes the underlying field type from  jquery_colorpicker to colorapi_color, adding a dependency  
                                                   on the Color API  module. As such, the configuration needs to be converted to match the new        
                                                   structure. This function handles the configuration changes.                                        
 -------------------- ----------- --------------- --------------------------------------------------------------------------------------------------- 


 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > 
>  [notice] Update started: jquery_colorpicker_update_8200
>  [error]  The "media_image" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are: colorapi_raw_hex_display, colorapi_raw_rgb_display, colorapi_text_display, colorapi_color_display, comment_username, comment_default, comment_permalink, country_iso_code, country_default, datetime_time_ago, datetime_plain, datetime_custom, datetime_default, entity_reference_revisions_entity_view, file_filemime, file_uri, file_url_plain, file_video, file_rss_enclosure, file_default, file_audio, file_link, file_table, file_size, file_extension, fivestar_percentage, fivestar_stars, fivestar_rating, geofield_latlon, geofield_default, image, image_url, jquery_colorpicker_text_display, jquery_colorpicker_color_display, jquery_colorpicker_raw_rgb_display, jquery_colorpicker_raw_hex_display, link_separate, link, oembed, media_thumbnail, slideshare_embed, metatag_empty_formatter, list_key, list_default, redirect_source, responsive_image, smart_trim, smileeu_common_string, smileeu_fivestar_stars, entity_reference_rss_category, text_summary_or_trimmed, text_default, text_trimmed, user_name, author, video_embed_field_thumbnail, video_embed_field_video, video_embed_field_lazyload, video_embed_field_colorbox, voting_api_formatter, webform_entity_reference_link, webform_entity_reference_entity_view, webform_entity_reference_url, paragraph_summary, entity_reference_entity_id, language, boolean, number_integer, timestamp, number_unformatted, entity_reference_entity_view, string, entity_reference_label, basic_string, timestamp_ago, email_mailto, uri_link, number_decimal 
>  [error]  Update failed: jquery_colorpicker_update_8200 
 [error]  Update aborted by: jquery_colorpicker_update_8200 
 [error]  Finished performing updates. 

How to resolve this issue and continue upgrade to major version?

Please, help.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine ankondrat4

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ankondrat4
  • πŸ‡ΊπŸ‡¦Ukraine ankondrat4

    Hello.

    After some time of investigations, I had upgraded Jquery Colorpicker from 1.4 to 3.0 version, after enabled modules Media Entity, Media entity image.
    Maybe it is more related to upgrading Media Entity to Media core in my case.

    Thank you for attention, I will close this ticket.

  • Status changed to Closed: won't fix about 1 year ago
  • Status changed to Active about 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine ankondrat4

    Hello.

    I try again do it and got errors(
    Besides, when I try to update by UI /update.php, then I got another error:

    jquery_colorpicker module
    Update #8200
    Failed: Drupal\Core\Database\SchemaObjectExistsException: Cannot add field 'block_content_revision__field_background_color.field_background_color_name': field already exists. in Drupal\Core\Database\Driver\mysql\Schema->addField() (line 414 of /var/www/html/web/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php).
    
  • πŸ‡ΊπŸ‡¦Ukraine ankondrat4

    If I enable and use jquery_colorpicker 3.0.x-dev version, then update finish successful.
    I found that it related to no supporting old format pattern of revision tables and it was resolved in https://www.drupal.org/project/jquery_colorpicker/issues/3210150#comment... πŸ› Upgrade from 1.4 to 2.0 failure due to revision tables naming pattern difference Fixed

    But issue with the "media_image" plugin stay not resolved and need to enable old module media_entity_image:

    >  [notice] Update started: jquery_colorpicker_update_8200
    >  [error]  The "media_image" plugin does not exist. 
  • πŸ‡ΊπŸ‡¦Ukraine ankondrat4

    In additional, after upgrade jquery_colorpicker from 1.4.0 to 3.0.x-dev version widget of jquery_colorpicker doesn't work.

    I see in console error:

    Uncaught TypeError: trigger.ColorPicker is not a function
        at initializeElement (jquery_colorpicker.js?v=8.9.20:88:13)
        at HTMLDivElement.<anonymous> (jquery_colorpicker.js?v=8.9.20:113:7)
        at Function.each (jquery.min.js?v=3.5.1:2:2976)
        at S.fn.init.each (jquery.min.js?v=3.5.1:2:1454)
        at inputWatcher (jquery_colorpicker.js?v=8.9.20:111:70)
        at Object.<anonymous> (jquery_colorpicker.js?v=8.9.20:143:7)
        at Function.each (jquery.min.js?v=3.5.1:2:3026)
        at init (jquery_colorpicker.js?v=8.9.20:138:7)
        at Object.attach (jquery_colorpicker.js?v=8.9.20:149:7)
        at drupal.js?v=8.9.20:25:24
    
  • πŸ‡ΊπŸ‡¦Ukraine ankondrat4

    One of workaround solution for working colorpicker - don't use library from vendor directory jaypan/jquery-colorpicker
    I have created a patch for it and now colorpicker is working on my site as expected after upgrade from 1.4 to 3.0.x-dev version.

  • πŸ‡ΊπŸ‡¦Ukraine ankondrat4

    Besides patch 16 with composer script "post-install-cmd" in comment 16 wor wor me too https://www.drupal.org/project/jquery_colorpicker/issues/3058398#comment... πŸ“Œ Upgrade instructions (8.x-1.x to 8.x-2.x) incomplete Needs review

Production build 0.69.0 2024