First of all, this is my first post here. I’ve been reading for a while and using a lot of tips.
That said, let’s get down to business.
A project I’m working on is starting to make itself into some kind of monster. We have a bunch of custom fields on multiple weblogs, categories, etc. that will need to be updated every once in a while. I’m currently working on an extension for just the weblog entries. I have it almost finished, but the wall I’m running into is what to do after they submit their changes. I’m currently using the following hooks:
edit_entries_extra_actions multi_edit_start
That adds the option to the edits page and lets me create my own form to edit just the fields. I noticed that the form action on the default multi_edit_form added “M=update_multi_entries” to the url, which would use the function by that name in cp.publish.php. The problem I’m seeing is that, in order to process the information the user updates, I would need to create a way to redirect to another function I write for processing. I have no idea what hook to use or if there is a way around it.
To put it in a nutshell: I don’t know the best way to process my custom multi_edit_form. If anyone has any ideas, then you will have my thanks.
Has this been addressed at all? I’m looking to write an extension that would add fields to the multi_edit page - but if it’s not documented how to process that, then I might get stuck real quick. Anyone ever added custom fields to the multi_edit form?
EllisLab, is there an example of why one might use this hook? It must be there for this sort of thing.
Attached is what I ended up doing. It doesn’t actually add to the multi-edit page, but rather creates it’s own multi-edit page.
There are probably plenty of bugs and it’s definitely not the most well-written code. It was, however, my first add-on that I wrote for expression engine, and it works for what I use it for.
Hopefully it helps someone else. Maybe if enough people are interested, I’ll go back and take a look at the code and make it a little prettier.
Wouldn’t mind to test this one out too to see how it does what it does but unfortunately when I try to go to my Extensions tab the whole page goes blank and nothing in the page source either. I have to take the extension out of the extensions folder in order to get the Extensions tab back again.
I have plenty of memory set as I am testing this on a localhost and have it ramped up fairly high for tests and such. Just wondering if anyone else had seen this problem and knew what it might be perhaps?
Best wishes,
Mark
Wow, this is a very interesting implementation - nothing like how I thought I would go about it if I were going to do something like this. Seems to work well, although, unless I’m not thinking this through fully, I might suggest flipping how the fields are now.
Instead of being able to make unlimited custom rows and selecting multiple fields from the full list of weblogs/fields (which, in my testing, was easy to make generate an error by selecting from multiple weblogs), I would think you’d list all the weblogs along the left (one row for each weblog) and then have a multi-select that has only the fields for that weblog.
Nice work!
Initially this looks like a great idea, however
Notice: Undefined index: field_related_to in /home1/editorsc/public_html/new/ecm/extensions/ext.idea_edit_multi_custom.php on line 896 Notice: Undefined index: field_related_orderby in /home1/editorsc/public_html/new/ecm/extensions/ext.idea_edit_multi_custom.php on line 907 Notice: Undefined variable: DB in /home1/editorsc/public_html/new/ecm/extensions/ext.idea_edit_multi_custom.php on line 911 Fatal error: Call to a member function escape_str() on a non-object in /home1/editorsc/public_html/new/ecm/extensions/ext.idea_edit_multi_custom.php on line 911
The reason this may be happening is due to the fact that the custom field I need to edit is actually a related entry field.
I hope there is a way to resolve this.
I also have a “monster project” that this would be great for. Even if it just updated regular / non-FieldFrame fields. Right now, though, I can’t quite get it to even display/modify normal text fields properly, and I get the same errors that Forrest reported at the top of the edit page when the extension is running.
KPowell, what could we do to encourage you / free up some of your time to work on this? 😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.