Problem/Motivation

This issue occurs when conflict module (8.x-2.0-alpha2) is enabled (on Drupal 9.1.14). When a poll has been translated, trying to edit and save the poll gives an error:

Error: Call to undefined method Drupal\poll\Entity\Poll::getChangedTime() in Drupal\conflict\Entity\ContentEntityConflictHandler->autoMergeNonEditedTranslations() (line 399 of /nrc/apps/www/myzone/web/modules/contrib/conflict/src/Entity/ContentEntityConflictHandler.php)

Steps to reproduce

Enable conflict module.
Create a poll.
Translate the poll.
Edit the original poll (or its translation).
Make a change and attempt to save.

Proposed resolution

Poll entity class needs updating to support and/or not break when conflict code runs.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork poll-3250729

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ClassicCut created an issue. See original summary.

classiccut’s picture

idebr’s picture

Version: 8.x-1.4 » 8.x-1.x-dev
Status: Active » Needs review
berdir’s picture

Status: Needs review » Needs work

While adding those fields is an option, it's conflict module that needs to check if an entity has that method/field before calling it. There is no requirement to have a changed field.

Adding this would require an update function as well.

ivnish’s picture

Status: Needs work » Postponed

Is this still relevant? How many poll users use also "conflict" module?

bramdriesen’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Category: Bug report » Feature request
Status: Postponed » Needs work
Issue tags: +Needs reroll, +Needs merge request

immaculatexavier made their first commit to this issue’s fork.

immaculatexavier’s picture

Status: Needs work » Needs review
bramdriesen’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll, -Needs merge request +Needs manual testing

The MR is a blind re-roll without reading through the issue what needs to be actually done.

I'm also still not sure if we need this, maybe it has already been fixed? I guess this can be manually tested (without the patch) to see if there is a conflict with the conflict module.

ivnish’s picture

Status: Needs work » Needs review
Issue tags: -Needs manual testing

  • bramdriesen committed d58aa622 on 2.0.x authored by ivnish
    feat: #3250729 Error saving polls after translation added when used in...
bramdriesen’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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