1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Problem uploading images after vB import

Discussion in 'Showcase Support' started by Ludachris, Mar 6, 2014.

  1. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Just finished up a test import and am trying to create a showcase item. I have it set that at least one image is required, but when trying to upload an image I'm getting an error. Here's what I see in the server logs area:

    ErrorException: copy(/home/site/public_html/forum/internal_data/attachments/127/127519-b4f62baac8d513fb83c26a113d714bdb.data) [<a href='function.copy'>function.copy</a>]: failed to open stream: Permission denied -library/NFLJ/Showcase/DataWriter/AttachmentData.php:61

    Let me know if you need the stack trace. Is it a directory chmod issue or directory ownership issue? I'm pretty sure I set the attachments dir to 777 but I can double check that and do it recursively if need be.

    Also, the second error says enter a valid message. It doesn't specify which required field wasn't filled in. What is it referring to?
     
  2. Bob

    Bob Developer Staff Member

    Yes, its a write permissions issues on the internal_data directory.
     
  3. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Does it matter if the attachment directories are owned by root while the script is owned by a different user?
     
  4. Bob

    Bob Developer Staff Member

    they need to be the same as all of the other attachments for core xf.
     
    Ludachris likes this.
  5. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    The attachments are all owned by root so I'll keep it that way. The XF system files are all owned by a different user though. Hopefully that doesn't create problems.
     
  6. Bob

    Bob Developer Staff Member

    all mine are owned by root on my development instances, so you should be OK with that. As long as you can upload and save, you should be g2g :)
     
  7. Bob

    Bob Developer Staff Member

    btw, the new version of SC is getting dangerously close to being ready for some beta testing... you interested in helping to test it? You'll need a test instance that can be blown away as these versions are NOT for upgrading live sites.
     
  8. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Alright, that fixed the image upload, how about the "please enter valid message"?
     
  9. Bob

    Bob Developer Staff Member

    Where is it happening?
     
  10. Bob

    Bob Developer Staff Member

    did you by chance disable the editor for Tab 1 and are only trying to use custom fields for that tab? Currently, you MUST use the editor for tab 1 (even tho you can disable it in the category options). I've changed this in SC 1.4.0 so that you can just use custom fields in Tab 1.

    That is the only place that I can think of that even throws that error for showcase item.
     
  11. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    When clicking the Create Item button. The only required custom fields I have are select menus. It doesn't specify any field ID or name.
     
  12. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    I do have it disabled... didn't want people to use that because I couldn't modify the description to tell them what to use the box for. I'll enable it and try.
     
  13. Bob

    Bob Developer Staff Member

    Custom Fields throws a different error message..

    The following error occurred:
    Please enter a value for all required fields.

    If you have the editor for Tab 1 disabled, that is the problem as the message field (which stores data for tab 1) is REQUIRED and throws that error. If you want to edit the DW, I can give you the code to change.
     
  14. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    That was it. Problem is I don't want that message area to be required. I guess I can modify the template to put a description just above that field to tell people what to enter into that field, and tell them it's required.
     
  15. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Oh yeah, that would be awesome if you could send me the code. Want me to message you my email addy?

    And I would be happy to help with the testing of the new version of showcase btw.
     
  16. Bob

    Bob Developer Staff Member

    There is nothing you can do with a template edit. It requires changes to the Item DataWriter itself.

    edit the file

    /library/NFLJ/Showcase/DataWriter/Item.php


    FIND (in the protected function _getFields() method):

    PHP:
                    'message'        => array('type' => self::TYPE_STRING'required' => true,
                        
    'requiredError' => 'please_enter_valid_message'
                    
    ),
    REPLACE WITH:

    PHP:
                    'message'        => array('type' => self::TYPE_STRING'default' => ''),
    You should then be able to disable the editor for Tab 1.
     
  17. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Easy enough, thanks again Bob.
     
    Bob likes this.
  18. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    That worked perfectly, thanks!
     
    Bob likes this.
  19. Bob

    Bob Developer Staff Member

    no problem :)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.