Just upgradet to Drupal 11.2.
Theme: "Adaptivetheme" with my own theme made by themegenerator.
In Drupal 10.5 "save_edit", v.1.8 was working fine.
After upgrading to Drupal 11.2 and Adaptivetheme v. 7, "save_edit" is not more working.

Comments

uv516 created an issue. See original summary.

maxilein’s picture

I can confirm: it is gone in Drupal 11.2

uv516’s picture

Will there br a version for Drupal 11.2+ ?

caesius’s picture

Title: Save_edit not workin in Drupal 11 » Module incompatible with Drupal 11.2

Thanks, I've confirmed that the "Save & Edit" button works as of Drupal 11.1.8 and disappears in 11.2.0 regardless of theme (Gin and Claro were tested).

I don't have a lot of time to investigate this independently, so contributions are welcome. The best place to start is to check release notes for 11.2.0: https://www.drupal.org/project/drupal/releases/11.2.0

I'll note that it works fine in Drupal 10.5, so any changes that are in both 10.5.0 and 11.2.0 can be ruled out: https://www.drupal.org/project/drupal/releases/10.5.0

maxilein’s picture

StatusFileSize
new17.58 KB

I have created a version that works for me. Here is the patch. Please check thoroughly I have not tested all functionality.
Maybe someone can work that into git. I don't know how I would that.

caesius’s picture

Hi, a few things:

1. This diff file doesn't follow the standard format for a .patch file. It should just be the output of git diff. Please review: https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
2. I get errors when attempting to apply the patch on the current dev version of the module:

╭─caesius@roscanvel ~/git/save_edit ‹8.x-1.x*›
╰─$ git apply save_edit_d11.2_compatibility.diff                                                                                                                                                                                       130 ↵
save_edit_d11.2_compatibility.diff:294: trailing whitespace.
}
error: SettingsForm.php: No such file or directory
error: save_edit.settings.yml: No such file or directory
error: save_edit.schema.yml: No such file or directory

3. Most importantly, this makes A LOT of changes, most of which appear unnecessary and were probably done by automatic refactoring.

Please pare this down to only the changes that are strictly necessary to get this working on Drupal 11.2. If the project really needs this much refactoring then that should only be done in the next major version (i.e. for 2.0.0)

caesius’s picture

Status: Active » Needs work
caesius’s picture

StatusFileSize
new325 bytes

I noticed this subtle change in the automatic refactor:

--- a/save_edit.module
+++ b/save_edit.module
@@ -7,7 +7,7 @@

 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\node\NodeForm;
+use Drupal\node\Form\NodeForm;

Applying it seems to work on Drupal 11.2, but it breaks on <11.2.

Change record: NodeForm and NodeTypeForm have moved to the Drupal\node\Form namespace

I have no idea why it breaks considering Drupal core appears to have only deprecated these classes, not removed them.
https://git.drupalcode.org/project/drupal/-/commit/49c6df3c876cc654c1f07...

I may need to release a v2.0.0 and require Drupal ^11.2. In the meantime, the attached patch should work.

caesius’s picture

Status: Needs work » Needs review
caesius’s picture

caesius’s picture

caesius’s picture

Version: 8.x-1.8 » 8.x-1.x-dev
Assigned: Unassigned » caesius
uv516’s picture

On a very short test:
I can confirm that the patch seems to work: The "Save & Edit" button is back and it works!

It seems that Drupal has moved the "NodeForm" from "Drupal\node\" to "Drupal\node\Form\". You can not use both of them and then it can not be deprecated.

Thank you very much for the patch. The change is very simple. :-)

caesius’s picture

2.0.0-rc1 has been released and has this change. There's also 2.0.0-rc2 which has the same new features as 8.x-1.9, but rc1 is an option for anyone who wants only the strictly necessary compatibility change; it's otherwise identical to 8.x-1.8.

caesius’s picture

Status: Needs review » Fixed

I went ahead and released 2.0.0 and spun off another issue to address backward compatibility: #3535599: 2.x: Allow backward compatibility for Drupal <11.2

I'll be closing this out.

maxilein’s picture

Thank you.

Status: Fixed » Closed (fixed)

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