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.

PHP error using Safecracker / images not deleted from directory

July 29, 2011 7:01pm

Subscribe [6]
  • #16 / Aug 16, 2011 12:00pm

    Sue Crocker

    26054 posts

    Unfortunately we can’t assist with local installs and with third party add-ons such as Matrix. With my MAMP install with no Matrix, I’m not seeing the same kinds of issues. If you have a non-local install, we might be able to assist with troubleshooting, but as it stands right now, we can’t do too much more.

  • #17 / Aug 16, 2011 6:13pm

    FarmBoy

    24 posts

    Thanks Sue I appreciate your patience.

    I should not have mentioned Matrix or Channel Videos.  The issue is with the EE jquery script tag {exp:jquery:script_tag} and SafeCracker.

  • #18 / Aug 17, 2011 3:31am

    John Henry Donovan

    12339 posts

    FarmBoy,

    To confirm. If you replace {exp:jquery:script_tag} with the following does it work?

    [removed][removed]
  • #19 / Aug 17, 2011 4:01pm

    FarmBoy

    24 posts

    John

    All I see is “[removed][removed]”  I guess the forum filtered the code out. Could you re-post it?  Thanks

  • #20 / Aug 17, 2011 4:06pm

    John Henry Donovan

    12339 posts

    FarmBoy,

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
  • #21 / Aug 17, 2011 4:56pm

    FarmBoy

    24 posts

    John,

    I confirmed the same result.  The error still occurs when replacing {exp:jquery:script_tag} with the google api script.

    For what its worth, the error disappears when I add another {exp:jquery:script_tag} beneath the safecracker form.  I’m not exactly sure what that means.

  • #22 / Aug 19, 2011 4:14am

    John Henry Donovan

    12339 posts

    FarmBoy,

    That’s unusual. The parameter include_jquery=“no” should take care of any conflicts like that.
    Try the safecracker_head=“no” parameter out of interest

  • #23 / Aug 19, 2011 3:30pm

    FarmBoy

    24 posts

    Using safecracker_head=“no” removes the PHP error.  Does that confirm a javascript conflict somewhere?

    From looking at the source code, I see the following scripts being added at the bottom of the safecracker form:

    1. Define the variable EE.
    2. Add javascript for the jquery ui and for EE.
    3. Add scripts for jquery datepicker.

    My Date fields have been working fine, so I don’t think its the datepicker scripts.

  • #24 / Aug 22, 2011 7:10pm

    Dan Decker

    7338 posts

    FarmBoy,

    Since safecracker_head=“no” prevents SafeCracker from adding extra bits of javascript, that seems like a logical conclusion. Does using that parameter resolve all of your issues? Or are you still seeing script conflicts?

    Cheers,

  • #25 / Aug 22, 2011 8:08pm

    FarmBoy

    24 posts

    Hey Dan,

    I’m afraid I can’t use safecracker_head=“no”.  I need the javascript that is involved with it.

    From viewing the source code, I can seem at the bottom of the safecracker form the variable “EE” is defined that includes a value for “BASE”.  Then the following script is called:

    <scrXipt type="text/javascript" charset="utf-8" src="http://www.huntfishplus.local/?ACT=7&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=scrollable,scrollable.navigator,ee_filebrowser,ee_fileuploader,markitup,thickbox,toolbox.expose,overlay,tmpl&v=1312216960"></scrXipt>

    Towards the bottom of that source I can view the script for ee_fileuploader, and its ajax call for “setup_upload()”.

    The PHP error occures when setup_upload() in /system/expressionengine/libraries/Filemanager.php doesn’t recognize “BASE”.  I’m not sure if it is looking for the same “BASE” that is defined in the safecracker javascript, or a value already defined in the php Filemanager class.

  • #26 / Aug 24, 2011 4:42pm

    Sue Crocker

    26054 posts

    Since we can’t replicate this locally, and you’re on a local install we can’t get to, is there any way you can put this up somewhere online?

  • #27 / Aug 24, 2011 5:01pm

    FarmBoy

    24 posts

    Sue,

    No not at this time. I usually develop a site locally first and then move it to a live web server.

  • #28 / Aug 25, 2011 7:09pm

    Dan Decker

    7338 posts

    Hi FarmBoy,

    Kevin Smith worked some similar issues the other day, and he has a clever solution that might work in your situation. Can you read through this and give his script a go?

    Let us know if you continue to need assistance.

    Cheers,

  • #29 / Aug 26, 2011 12:48am

    FarmBoy

    24 posts

    Dan,

    Thanks for the thread.  I actually had tried that code from Kevin’s post before.  I tried it again but with no luck.

    Really that fix is for a javascript conflict, but I have no javascript errors, only the PHP error of “Use of undefined constant BASE - assumed ‘BASE’” showing in the Firebug console.

    {-----------------------------------------------------------------------}

    When I run the following script beneath the safecracker form

    <scrXipt type="text/javascript">console.log〈EE.BASE〉;</scrXipt>

    It reads “http://www.example.local/?”

    This tells me the object EE and “BASE” is good before and after the following script
    that I mentioned before:

    <scrXipt type="text/javascript" charset="utf-8" src="http://www.huntfishplus.local/?ACT=7&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=scrollable,scrollable.navigator,ee_filebrowser,ee_fileuploader,markitup,thickbox,toolbox.expose,overlay,tmpl&v=1312216960"></scrXipt>

    In the the above script, I can see the first instance of “BASE” after “setup_upload” in the line containing “url:EE.BASE+”&”+EE.fileuploader.delete_url”.  I’m not sure if that has anything to do with the error, but wanted to point it out.

    Is there any reason why the FileManager class would not recognize this constant?  Any setting in php.ini? etc. Could someone tell me how the ‘BASE’ constant is defined in Filemanager.php?

    Thanks

  • #30 / Aug 28, 2011 5:25pm

    Dan Decker

    7338 posts

    FarmBoy,

    I combed through Filemanager.php and it *appears* that BASE is undefined. But that’s just me looking over the surface. I’m going to run this up to the Devs to see if they have any insight.

    Thanks for your patience.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases