D8 using same code from the original D7 core patch. D8 issue is closed as fixed. Please commit and fix D7 asap.

Backport ticket issue same as #1862892: When a theme has a managed_file field and a submit callback, call to undefined function error is thrown.
That issue was originally a D7 issue hijacked by D8. Original patch by @Peterpoe

Opportunity overview:

This bug is preventing many themes from working with managed files. Most notably Template monster is the most affected, dozens of quality themes break when updated because of this core issue. Many themers have pulled out all their hairs and given up along the way. For an average themer, Drupalista, or even an expert awesome Drupalista it is not easy to figure out why this is happening so lets just fix it so that we can restore confidence in our product.

Here is an example of some very awesome themes are affected and REQUIRE this issue to be fixed:
http://info.template-help.com/help/drupal-template.html

Remaining tasks:

  1. backport the theme tests from. #1862892-158: When a theme has a managed_file field and a submit callback, call to undefined function error is thrown. and then we expect 1 fail when running the tests only patch and all green passes when combined tests with the existing D7 core fix patch attached to this issue. *edit* this fix is urgently needed, can we please skip backporting the D8 test

Special thanks to Peterpoe

for his patch from years ago that fixes the issue. #1862892-7: When a theme has a managed_file field and a submit callback, call to undefined function error is thrown.
Lets get this in for Peterpoe and the thousands of Drupalistas that need and want this fixed.

Comments

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Issue summary: View changes
Status: Needs review » Needs work
joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Component: system.module » theme system
joseph.olstad’s picture

Status: Needs work » Needs review

The patch works great, however, prior to committing the fix we should probably backport the D8 Tests from #1862892-148: When a theme has a managed_file field and a submit callback, call to undefined function error is thrown..
but, imho, all existing tests pass with this patch so that might be good enough no?
It'd be nice to get this in soon because it's already been over 5 years if you look at the parent issue which originated when D7 was not even released yet.

joseph.olstad’s picture

Issue summary: View changes

D8 patch was committed, houray!
D7 fix is ready , needs to be committed in a release

Remaining for D7:

  1. *EDIT* please lets skip backporting the D8 testWhat is left is we need to backport the D8 tests only patch from #1862892-158: When a theme has a managed_file field and a submit callback, call to undefined function error is thrown.
  2. *EDIT* please lets skip backporting the D8 testThen run tests only patch , expect 1 fail, then run tests patch with fix and expect 100% pass.
joseph.olstad’s picture

Status: Needs review » Needs work

I will be on training next week, anyone care to take a stab at backporting the test? please?

joseph.olstad’s picture

Status: Needs work » Needs review

@David.Rothstein, is it really necessary that we backport the tests? the patch works great

joseph.olstad’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +Drupal bugfix target
Related issues: +#2909375: Fatal Error

Template monster tech support needs this core fix asap
see:
#2909375-4: Fatal Error

joseph.olstad’s picture

Issue summary: View changes
jollysolutions’s picture

rtbc+1

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.84 KB
new3.76 KB

The patch itself looks great.

As for tests, I agree that the ones in Drupal 8 look like overkill to backport, but we should be able to just test this more simply instead. In the attached, I wrote a little test that just forces the theme setting form to be cached and then does some clicking around to ensure the form can be saved, the submit handler is called, etc. I think it should get the job done.

The last submitted patch, 23: 2900373-23-TESTS-ONLY.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

I agree that's pretty clever, thanks for the test.

ckoharj’s picture

I used the system.inc patch #2 for D7 on a hostgator shared server.
It resolved the fatal error:
Fatal error: Call to undefined function theme1043_form_system_theme_settings_submit() in /home/user/public_html/foldername/includes/form.inc on line 1520

But when you go to theme settings and save the configuration it overuses CPU resources on the server and my account was shut down.
I verified this a second time with them on the phone.

Without the fix and the fatal error = No problems with overusing resources.
With the fix and able to save theme settings = Saved successfully but overusing resources.

joseph.olstad’s picture

@ckoharj that sounds more like a hosting provider issue than a problem with the patch. Without the patch a fatal error is very unhelpful and tough to debug.

Many themes just won't work at all period with newer contrib unless using the patch and my testing did not show any performance issue with the patch.

Great work by @David_Rothstein on the tests thanks so much! This will help allow people using affected themes to upgrade their core and contrib modules. Some very good themes will be available to a wider audience thanks to this fix.

joseph.olstad’s picture

@ckoharj try hosting with pantheon instead. A friend of mine works there and they have a good reputation.

Personally I have 2 dedicated servers as I do not trust anyone else to run my stuff because I once was locked out of a hosting account that I paid for, since then I refuse to host outside.

joseph.olstad’s picture

The October core maintenance release window has come and gone. Hopefully there will be a release in November with this fix (and others) in it.

joseph.olstad’s picture

David Rothstein, I've been using this fix for months now and its been working well, no surprises. Also, virtually the same fix is in D8 and a tagged release of Drupal 8 is using virtually the exact same fix. There has been no negative feedback in the D8 issue either. I'll be willing to bet money that this is a very safe change to make that will not break compatibility (it actually improves compatibility).

I see that you've done some recent commits to 7.x dev , how about this one? Please?

#2900373-23: [D7] When a theme has a managed_file field and a submit callback, call to undefined function error is thrown.

joseph.olstad’s picture

Hello David, your patch 23 is working fabulously, as maintainer of media I am still getting issues raised in the queue regarding this issue, so people are still encountering this. It would be so nice if your patch was committed, it has test results and again the D8 version of this fix has been in the wild for a long time with no reported regressions.

#2900373-23: [D7] When a theme has a managed_file field and a submit callback, call to undefined function error is thrown.

I'd commit this right away in the dev branch.

joseph.olstad’s picture

Issue tags: +Pending Drupal 7 commit

FabianX, this is good to go in, it's already in D8, has tests thanks to David Rothstein.

fabianx’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Drupal bugfix target, -Pending Drupal 7 commit

Committed and pushed to 7.x. Thanks!

  • Fabianx committed b014c19 on 7.x
    Issue #2900373 by David_Rothstein, joseph.olstad, jollysolutions,...

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture

Thanks again! woot!

mustanggb’s picture

Issue tags: -Drupal 7.60 target