ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to push the envelop of SafeCracker / SAEF...Help?!?

May 23, 2012 12:19pm

Subscribe [1]
  • #1 / May 23, 2012 12:19pm

    ChiefAlchemist

    913 posts

    In short, I want to set up a single form but within it multiple entries (from the same channel). Each entry can be edited one at a time. In fact, (at this time), I’m only looking to edit one field from the channel. I’m not looking for a single mass form (because it’s not the best UX and I just don’t think it’s possible. So I’ve settled for something clean & simple.)

    I’ve set up (read: having working) a simple snippet of jquery that I bind to an edit link next to each entry. It hears the click of an edit link and a text box appears next to the field to be edited along with submit button. therefore, at this point there’s only one entry “open” to being edited. That keeps me within the confines of SafeCracker and EE, correct? Prior to the form being serialized I’d change the entry_id in the form’s hidden fields and then let jquery.form.js handle the rest. Again, from a form perspective there’s only a single entry being updated (via Ajax).

    Unique and pretty cool but not rocket science, right? 😊

    However, I can’t get the exp:channel:entries loop to spit out more than one entry within the form tags. I’ve even gone so far as to take out the Safecracker tags and am nowgenerating the form and hidden fields “manually”. That is, I’ve coded them into the template instead of letting Safecracker do that direct work.

    Still something within the form seems to be stopping multiple entries from being listed.

    WTF??! :(

    Is this some sort of parsing issue perhaps. (Note: That just hit me. I’m gonna see about doing the listing in an embed). Might I have to sidestep native EE with some PHP to get around this built-in (?) limitation.

    Finally, presuming I go this route - btw, I don’t have much of a choice given the biz requirements - are there any concerns I should have about security, etc. Am I opening up a hole in the EE / SC armor? I’m using the XID_HASH to assign a value to that hidden field. What else must I be concerned about?

    Help? Please?

    Mark

  • #2 / May 23, 2012 3:02pm

    ChiefAlchemist

    913 posts

    I can and do get the full listing when I use an embed. The ol’ parse order trick never fails, eh 😉

    That said, I’m curious as to how / why even if I didn’t use SafeCracker EE was able to force me to only list one entry.

    Finally, based on the UX / update process described above, in terms of security, is there anything I need to worry about? Am I creating a “hole” by creating the input fields on the fly? This is only my third time messin’ with SAEF and SafeCracker and I’m obviously pushing things a bit.

    I have a proof of concept working. Pretty cool to be quite honest. But I need to be sure I haven’t pushed too far and opened up a can a worms in putting my innovative solution into play.

    Thanks in advance -
    Mark

  • #3 / May 24, 2012 1:52pm

    ChiefAlchemist

    913 posts

    With all due respect to the EE moderator (to me) this is a fairly technical question about the inner working and underbelly of EE. Perhaps it’s not “Tech Support” but it’s not general “Community Help” either.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases