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.

Safecracker EE 2.6 dynamic title

May 24, 2013 3:04pm

Subscribe [3]
  • #1 / May 24, 2013 3:04pm

    bryan2jumpstart

    98 posts

    Seems to be a bug in safecracker in EE 2.6. I see it’s been moved to the first party module area and it seems dynamic title is not picked up in the processing. At line 1441 in safecracker_lib.php it checks the POST for dynamic_title but it’s no longer located there and actually embedded in the meta post variable. I adjusted the line to check for dyanmic title at $this->_meta[‘dynamic_title’] and it seems to be working now.

  • #2 / Jun 13, 2013 2:18pm

    zerovapor

    14 posts

    I keep having the same problem with all my new 2.6 sites. Getting really frustrating!

    I’m not familiar enough with PHP to understand exactly what you changed. Can you tell me what exactly I should add/replace in that file?

  • #3 / Jun 13, 2013 2:22pm

    bryan2jumpstart

    98 posts

    I keep having the same problem with all my new 2.6 sites. Getting really frustrating!

    I’m not familiar enough with PHP to understand exactly what you changed. Can you tell me what exactly I should add/replace in that file?

    Just go to line 1441 in the safecracker module file. I believe it’s located at /system/codeigniter/modules/safecracker/mod.safecracker.php and you will see where it’s looking for $_POST[‘dynamic_title’], just change to $this->_meta[‘dynamic_title’]

  • #4 / Jun 13, 2013 2:43pm

    zerovapor

    14 posts

    Oh, I was looking in the file you mentioned previously, which I found at /system/expressionengine/modules/safecracker/libraries/safecracker_lib.php

    Line 1441 says…

    if (ee()->input->post('dynamic_title'))
    $_POST['dynamic_title']

    is not found anywhere in the docuement.

    There is not a /modules folder under /system/codeigniter, but there is a mod.safecracker.php in the /system/expressionengine/modules/safecracker folder. That file, however is only 83 lines long and does not contain “dynamic_title”

    Thank you for your help. We just need to narrow down exactly which document you updated and what it was that got replaced. I’m running 2.6.0.

  • #5 / Jun 13, 2013 2:47pm

    zerovapor

    14 posts

    I tried replacing

    post('dynamic_title'
    with
    $this->_meta[‘dynamic_title’]

    but it’s throwing me these errors. I’m assuming it just amounts to bad syntax. Again, I don’t know what I’m doing with PHP. But I am undoing everything each time to make sure I’m not leaving mistakes in there when running a new test.

    Message: Object of class Safecracker_lib could not be converted to string
    Message: Object of class Safecracker_lib to string conversion
    Message: Undefined property: EE_Input::$Object

  • #6 / Jun 13, 2013 3:15pm

    bryan2jumpstart

    98 posts

    SOrry you need to replace all of ee()->input->post(‘dynamic_title’) with that

  • #7 / Jun 13, 2013 3:45pm

    zerovapor

    14 posts

    GOT IT! THANK YOU SO MUCH!

    Actually, I had to submit the form a few times because the first time, it validated but gave me “ʋ” as my title instead of the text I specified in the dynamic_title param. But the 2nd and 3rd post are working properly. Weird…but whatever. It works now! Thank :D. I will repeat this patch on my other sites.

    Oh, btw, to anybody else that runs across this, there are TWO instances to replace: on lines 1441 & 1443; just to clarify for others like myself that need it spelled out.

  • #8 / Jun 13, 2013 3:51pm

    zerovapor

    14 posts

    Wait…no, it’s still not working. I’ve been updating and undo-ing my form too many times and got the fix mixed up with my work-around (just using a hidden input with the title instead).

    Your fix IS validating the title but it’s posting a single glyph instead of the text written in the dynamic_title param. The first time, the title came through as “ʋ” but now it’s coming through as a comma, “,”.

    This is weird…

    I had another developer try the update with your fix. I’m not sure what exactly he changed but I had the same result.

  • #9 / Jul 15, 2013 2:29pm

    bryan2jumpstart

    98 posts

    Wait…no, it’s still not working. I’ve been updating and undo-ing my form too many times and got the fix mixed up with my work-around (just using a hidden input with the title instead).

    Your fix IS validating the title but it’s posting a single glyph instead of the text written in the dynamic_title param. The first time, the title came through as “ʋ” but now it’s coming through as a comma, “,”.

    This is weird…

    I had another developer try the update with your fix. I’m not sure what exactly he changed but I had the same result.

    FOrgot you also need to get rid of the base64_decode function on line 1443 as it’s no longer needed.

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

ExpressionEngine News!

#eecms, #events, #releases