Currently panopoly magic has a limited set of forms that it can change and this set is hardcoded in the module.

Comments

hernani’s picture

hernani’s picture

The attached patch allows other modules to manipulate the list of forms to be altered.

dsnopek’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not sure I understand the use case for this. What other forms could you want Panopoly Magic to alter? It's pretty specific to the forms it's meant to work with.

segovia94’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new36.2 KB
new48.98 KB

This is actually just what I needed.

I have several custom panel content types which look ugly if they don't have their form added to the list to create a general settings fieldset. Having the ability to add a field gives me better control over my custom module display.

Without the form ID added:
without the form

With the form ID added:
with the form

The patch worked for me.

dsnopek’s picture

Status: Active » Needs work

Aha... Ok, that makes sense! Since it's only an additional alter hook and doesn't affect anything else, it should be safe to commit. All we need is some documentation for it in a new panopoly_magic.api.php.

dsnopek’s picture

Status: Needs work » Needs review
StatusFileSize
new2.44 KB

Ok, here is a new patch that adds panopoly_magic.api.php. Also, I removed the hook_panopoly_magic_form_ids_to_alter_alter() because I don't think that one actually made sense. The variable it was altering was just for specifying a few extra forms to put a live preview on - all content pane settings forms were already being altered, so I don't think anyone would ever need to add one to the list (but I could be wrong! If you have an example, please let me know).

Anyway, check out the attached patch and let me know if this still works for your use case!

segovia94’s picture

Great! #6 works fine.
There is some unneeded whitespace added though.

+++ b/panopoly_magic.module
@@ -452,8 +452,10 @@ function panopoly_magic_form_alter(&$form, &$form_state, $form_id) {
+    ¶

Here is the patch from #6 with the whitespace line removed.

dsnopek’s picture

Status: Needs review » Fixed

Thanks! Committed. :-)

  • dsnopek committed 3cd90a0 on 7.x-1.x
    Update Panopoly Magic for Issue #2261061 by segovia94, dsnopek, hernani...

Status: Fixed » Closed (fixed)

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