Enabling fails because of configuration conflicts

Created on 21 May 2024, 6 months ago
Updated 16 September 2024, 2 months ago

Problem/Motivation

After successfully requiring 2.2 (composer require 'drupal/smart_date_starter_kit:^2.2'), enabling the module fails with the following error:

# drush en smart_date_starter_kit   

In PreExistingConfigException.php line 65:
                                                                                                                                                                                          
  Configuration objects (core.entity_form_display.node.event.default, core.entity_view_display.node.event.default, core.entity_view_display.node.event.teaser, field.field.node.event.body, node.type.event) provided by smart_date_starter_kit already exist in active configuration 

This is because there is an existing event node type.

Steps to reproduce

Create and event node type. Attempt to install and enable the module.

Proposed resolution

My Proposed resolution is to use a less-likely-used content type name than "event". E.g "smartevent". Or have some logic in the installer to otherwise remediate this conflict.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: won't fix

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ys2n

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

Comments & Activities

  • Issue created by @ys2n
  • Status changed to Closed: won't fix 3 months ago
  • πŸ‡¨πŸ‡¦Canada mandclu

    By design this module provides a simple, but robust (and expandable) starting point for an events management system in your Drupal site. If you already have an events setup on your site, this module isn't for you. I have written a tutorial that explains the steps to add Smart Date to an existing site's event system β†’ , which may be more what you need.

    Also, there is some Smart Date support written into the Schema.org Blueprints module β†’ , which allows you to choose the name for content types you create with it, so that might also be a solution for you to consider.

  • πŸ‡ΊπŸ‡ΈUnited States cassio

    We have some content in an event content type. The error the OP references is in red, and it is not clear if it finished configuring or what the next step is. It also doesn't say what to do with the existing content type in terms of documentation. (The migrated content type does use smart date and was configured using a similar module in a previous version.)

    In my view, this is a bug and should be fixed or this error message needs to be much better and reference a known issue with a hyperlink. Changing the name would be easy and not conflict with date tools in d6 and d7. Thanks for all of this work.

    To reproduce:
    use composer require calender starter kit. The starter kit is a requirement. (therefore preventing successful installation of any of the modules.) The error appears in red with no notion that it is because the maintainer won't rename the content type. it just looks like it failed.

  • πŸ‡¨πŸ‡¦Canada mandclu

    Thanks for the additional context.

    To be clear, however, any errors generated while installing this module are not generated by this module. They are generated by Drupal core while attempting to import the configuration provided by this module. Perhaps the README and/or project page could include more information on use cases where this module is not intended to be used.

    If your site is on Drupal 11 you might find that applying the Events Calendar recipe is more flexible. It will similarly I stall the Events recipe first, which still has the potential to have conflicts with your existing content type. That said, the Events recipe uses config actions (exclusive to the recipes system) to be more flexible.

    At the end of the day, both this module and the Events recipe are intended to be starting points, and additional solutions designed to extend then will naturally require the existing config to have certain characteristics. As an example, both calendar solutions expect to retrieve content of an Event content type, and are configured to use the data from a field_when field for the calendar display. If these don't conform to how your existing content type is set up, then you could still benefit from installing these solutions on a separate, fresh install of Drupal, and then use the installed calendar view as a reference for how to build your own.

  • πŸ‡ΊπŸ‡ΈUnited States cassio

    thank you. that was very helpful.

  • πŸ‡ΊπŸ‡ΈUnited States dalemoore

    I have written a tutorial that explains the steps to add Smart Date to an existing site's event system, which may be more what you need.

    I just ran into this same issue, and the link goes to Schema.org Blueprints. A Google search isn't returning anything helpful. Can you link the tutorial here?

Production build 0.71.5 2024