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.

Error: Path That You Are Submitting Is Invalid

April 04, 2011 8:11pm

Subscribe [4]
  • #1 / Apr 04, 2011 8:11pm

    reinvent

    118 posts

    This is strange and seems to be effecting more then the Avatar Upload in this case.

    Running EE 2.1.3

    I am having path errors when trying to upload Avatar inside my member account (Super Admin)

    I am having path issues when trying to resolve a conditional call for a Avatar. (not sure if this related but may tie in somewhere)

    Bad Path it resolves:(adds the /index.php/)
    http://www.gravatar.com/avatar/f470fac566bbc5bb274720a707f64b98?s=80&r=PG&d=http://www.merchantdoctor.net/index.php/images/avatars/uploads/no_avatar.jpg

    BUT SHOULD RESOLVE THIS:
    http://www.gravatar.com/avatar/000000000000000000000000000000000?s=80&r=PG&d=http://www.merchantdoctor.net/images/avatars/uploads/no_avatar.jpg

    And getting the error (Path That You Are Submitting Is Invalid) when trying to reset the path to the Avatar Dir. in Member Preferences

    The server path is: /www/eh15466/public_html/images/avatars/uploads/

    I have checked:

    1. confirmed Dir to 777

    2. confirmed that I can find the avatar with the direct URL

    3. confirmed: Check the Server Path to folder via running this php file in the location

    <?php echo realpath(dirname(__FILE__)) . '/'; ?>

    Any Thoughts…I have gone through this many times…

  • #2 / Apr 04, 2011 10:44pm

    narration

    773 posts

    I’m going to answer over here - realized later that we were not under Tech Support on first question.

    - looks like you are much closer to solution; good.
    - the problem with your no_avatar.jpg is that the index.php does not belong in the path. You want a direct load from the webserver, not to activate EE.

    If I take the index.php out, I get what is obviously your own crafted no_avatar-avatar.

    Try it yourself:  http://www.merchantdoctor.net/images/avatars/uploads/no_avatar.jpg, which looks fine.

    Since you probably still have the images/... part set properly in the avatar code, I am guessing that you have set the ‘URL to the root directory of your site’, on Admin>General Configuration, to include the index.php. However, it must _not_ include index.php, just http://www.merchantdoctor.net. Put the index.php in the ‘Name of your site’s index page’, the field just above.

    - This could actually be causing all kinds of problems, so please fix it before going farther.

    Please be sure to clear all caches, using Tools>Data>Clear Caches and selecting all, then Submit, after you’ve fixed this, as a hygiene move. Then verify that this has fixed your problem with the no_avatar icon, at least.

    - Now, testing the URL you show here as a result for the avatar image src seems to show that the Gravatar code in it is wrong. If I use your full url minus the index.php, I get the no_avatar jpeg properly; and if I use the url with all the query options removed, I get the Gravatar default no-avatar, also properly. So far, so good—for a bad code.

    However, that code is what EE Gravatar has looked up for your commenter email, so it should be a valid one. Maybe you posted a deliberately altered code here. Or if not, maybe that code will self-correct once you get the above problem fixed and caches are cleared.

    - I am presuming that you used the checker I gave you link for to be sure Gravatar.com recognizes the commenter email properly. Fix the first problem above, and you’ll see your no_avatar.jpg if Gravatar can’t recognize the email, which should take some of the stress out here, and let you solve the rest.

    - what you say about path issues is odd. That looks like a reasonable EngineHosting server path, and I presume you’ve got it in the Server Path blank under Members>Preferences>Avatar Preferences. I’ll also presume you’ve got the full http://www.merchantdoctor.net/images/avatars/ set for the URL to Avatar Folder.

    This combination should let a Member’s Upload Avatar work under his profile’s Edit Avatar page. I know it works in 2.1.4beta as well as previously, as have done it many times, and as Site Admin especially.

    - I want to stop with this review, and let you go through it to see what may turn up. If you repair the first problem, and assure the rest is fully set up, and still have issues, then you may need the step-by-step I recommended over on the EE Wiki Discussion for assuring you don’t have add-on collisions somehow causing part of your issues.

    I’d take a break, however, and take this all slowly, and perhaps with a few less red letters.

    Very likely it is still just a configuration problem, and that apparently misplaced index.php in the first item above, or whatever is causing the appearance of it, may be the whole key. Patience is a virtue, Confucius said 😉

    Take care, and let’s see how you go further on this now, reinvent.

    Regards,
    Clive

  • #3 / Apr 04, 2011 11:12pm

    reinvent

    118 posts

    First Clive,

    Thanks you so much for your time and expertise. I am humbled by your generosity!

    First, the red letter thing was just to try to make it easier to read as I know how tough it can be sometimes to glance through a post and try to get a sense of what is what..actually, I feel great and enjoy the process of learning..so I am cool. On second thought, I can see how the red letters may look aggressive and maybe misinterpreted.

    1. General Config was fine and when I read it thought aha…but it was setup properly.

    2. Purged the Cache

    (still having the same issue on returning a strange path to the no_avatar.jpg.)

    BUT, you did solve the avatar upload issue…I added the uploads directory to the string…when I stripped it all is fine on that front.

    3. Defiantly still putting in the “index.php”

    I agree I will take a break and check all the code in the avatar div and see if I find another problem there…

    Thanks and I will post more when I take a fresh crack at it.

    Have a great evening;)

  • #4 / Apr 04, 2011 11:18pm

    narration

    773 posts

    Good man 😉

    And I am really glad you made the avatar upload problem disappear, as that could have been more troublesome. Actually, it shouldn’t be, and maybe we’ve discovered here how people often have difficulty with it.

    I kind of think that index.php issue ought to sort easily too, and glad you are taking a break for fresh eyes.

    I had a rapid thought here to be sure you’re not using an .htaccess—have been presuming not because of visible index.phps, but it is another thing to check or just pull out of the picture.

    Take care, and let us know.

    Regards,
    Clive

  • #5 / Apr 05, 2011 7:32am

    John Henry Donovan

    12339 posts

    Thanks Clive 😊

    reinvent,

    can we take a look at your conditional to see what you are attempting and try and replicate it?

  • #6 / Apr 05, 2011 9:36am

    reinvent

    118 posts

    Good Morning….Thanks for taking the time.

    {exp:comment:entries channel="articles"}
          <div id="commentWrap">
    
            {if avatar} 
                {avatar_url}  
            {if:else}
                {exp:gravatar email=
            {/if}
                <div id="commentBlock"><span class="archivepostblack">{name} | {comment_date format="%F %d %Y"}</span>
                  {comment}              
                </div>
    
        </div>
    {/exp:comment:entries}

    BTW: Not running .htaccess file…

  • #7 / Apr 05, 2011 1:43pm

    narration

    773 posts

    Good morning also, reinvent.

    From what you’ve reported, and looking now at your site comments page from the work over on the Wiki Discussion, it looks like you’ve got everything else operating ok—that the only thing remaining is this path-which-shouldn’t-have-index.php problem.

    I’m seeing your real avatar where that should be present now, and still the broken avatars that should be the no_avatar default jpg instead. Indeed they do have a false /index.php/ in their paths.

    Given what you checked about the General Configuration, this is honestly a bit odd, as the settings there are supposed to guide results for the {path="rest of url"} variable.

    I don’t see what difference it should make, but one thing I would try is inserting a simple debug line in your template, just above the whole avatar code block. Overall it would like:

    <div id="commentWrap">
    
    Test pathing: {path="/a/dummy/path.jpg"}
    
            {if avatar}....

    This will mess up your formatting, but give a local idea what path= is doing. I imagine it will show improperly also with an index.php in it—and then this is what has to get solved to get you fully back on the air.

    On that score, and because the documentation is just a bit vague for the path= variable, I’ve had a look at the EE code about this, and it is both straightforward and full of the usually thoughtful amount of EE cross-checks to keep you out of trouble. I doubt it’s been touched in a while also.

    Some things to ask occur:

    - do you perhaps have the site path manually defined elsewhere, improperly with the index.php in it? Candidates would be within your main site index.php file itself, or in system/expressionengine/config/config.php. You would be looking for an uncommented item with site_url in it—and possibly a (mis-)matching site_index.

    - similarly, are you by chance using the MSM/Multiple Site Management module? In that case, are there further places where you might have defined site_url, etc.?

    Given all your other problems look solved, I’m guessing we’re pretty close now, reinvent.

    Regards,
    Clive

  • #8 / Apr 05, 2011 6:28pm

    reinvent

    118 posts

    Well, I have looked over everything and rechecked things and I cannot seem to find anything…

    I have the EE portion of the config.php file because at one point I did at some lines to troubleshoot a login issue…but removed them after that was solved.

    <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    
    /*
    |--------------------------------------------------------------------------
    | ExpressionEngine Config Items
    |--------------------------------------------------------------------------
    |
    | The following items are for use with ExpressionEngine.  The rest of
    | the config items are for use with CodeIgniter.
    |
    */
    
    $config['app_version'] = '213';
    $config['install_lock'] = "";
    $config['license_number'] = "XXXX-XXXX-XXXX-XXXX";
    $config['debug'] = '0';
    $config['cp_url'] = "http://merchantdoctor.ehclients.com/(**SYSDIR NAME**)/index.php";
    $config['doc_url'] = "http://ellislab.com/expressionengine/user-guide/";
    $config['is_system_on'] = "y";
    $config['site_label'] = 'Merchant Doctor';
    $config['cookie_prefix'] = "";
    
    
    // END EE config items
    
    /*

    I am going to run the test path and see what that gives up…but seems that it will return the same problem…

    Will report back

  • #9 / Apr 05, 2011 6:35pm

    reinvent

    118 posts

    Ya..returned: Test pathing: http://www.merchantdoctor.net/index.php/a/dummy/path.jpg

    SO that /index.php/

    IS still looming…

    I will check the system settings again…

  • #10 / Apr 05, 2011 6:49pm

    reinvent

    118 posts

    Screen Shot of the General Config

  • #11 / Apr 06, 2011 10:29am

    reinvent

    118 posts

    Well, here is the question for the EE folks…why would

    {path="/a/dummy/path.jpg"}

    render a path that includes “index.php”

    Currently: http://www.merchantdoctor.net/index.php/a/dummy/path.jpg

    Should Be: http://www.merchantdoctor.net/a/dummy/path.jpg

    I have attached the site settings screen shot.
    I have attached the config.php files below…
    I never touched the index.php file as this is a new install.

    As a side thought, I am having a problem that maybe related, that is the next thing I am going to try to tackle:

    Blog View Pages HERE do not render the title URI (instead the URI entry number) from this PAGE but does render proper URI title from the HOME PAGE page (note: the blogroll links from the lower right hand corner)...View same page HERE linked from the home page. Hmm.

    Exactly the same code is being used in both places….

    {if player_switch == "Text"}
                          <a href="http://{permalink=site/blog_detail}"><div id="blogroll_pixWrap">                _                              <div id="BlogRollPix">{blog_image}</div>_                        </div></a>
                    {/if}
                    {if player_switch == "Video"}
                          <a href="http://{permalink=site/blog_detail_video}"><div id="blogroll_pixWrap">                _                              <div id="BlogRollPix">{blog_image}</div>_                        </div></a>
                    {/if}

    Any Help would be most welcomed and appreciated.

    Thanks

  • #12 / Apr 06, 2011 2:35pm

    narration

    773 posts

    Hi reinvent - have just been able to come back on this.

    Let’s keep making things simple, as much as we can.

    - on your question about the two different blog page links, you say that you are using the same code in both place. However, your results look like you’re using slightly different code.

    Is it possible you used {title_permalink} on the home page, but {permalink} on the blog page? That would give the results you see, per the EE documentation.

    - Edit: the index.php problem I think is solved, and not about your config—please see following posting.

    Regards,
    Clive

  • #13 / Apr 06, 2011 3:19pm

    narration

    773 posts

    Ok, hold the phone here.

    reinvent, this index.php thing is actually my fault in the wiki posting, and for that I apologize. I had written there months ago, to clean up what didn’t work well, and in doing so, I’d kept part of the original wiki code—and it unfortunately wasn’t quite right.

    The problem comes in using the {path=} variable to get that default for gravatar.com. That’s intended for EE template paths, and in fact it will _always_ include what you set for index page in the General Configuration. I didn’t notice this, nor apparently did others, because of running my sites with index.php taken out. Put it back in, and I see just what you do.

    What should be used instead is the {site_url} variable, if we want to assure the full path on the image, which is a good idea. I’ve modified and tested your avatar code fragment to work this way, and think it will do the trick if you copy-paste the following, so that all the small punctuation changes come through:

    {if avatar} 
      {avatar_url}  
    {if:else}
      {exp:gravatar email=
    {/if}

    So you don’t I think have a problem in your configuration, and don’t need to make the extra check, or post your config.php.

    I’ll put corrected code on the Wiki, once we verify that everything’s ok with you here, and make a note on the Wiki Discussion where we started.

    You’ve actually uncovered something that will no doubt help others in the future, reinvent, so that’s the benefit. We got a few of your other issues fixed as well.

    Regards,
    Clive

    Edit: updated to use your avatar code just as you have it in most recent posting

  • #14 / Apr 06, 2011 5:58pm

    Sue Crocker

    26054 posts

    OK, reinvent - Clive’s been really busy helping out here.. where are you at with this?

  • #15 / Apr 06, 2011 6:41pm

    reinvent

    118 posts

    Hey Clive…

    Thanks so much for all your help…all problems have been resolved.

    You are a real credit to this community and I am amazed by your generosity and expertise.

    I have not had many correspondences like this on the net and will be sure to look for an opportunity that I might be able to do the same for someone else in the future.

    Have a great week!!!

    matt

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

ExpressionEngine News!

#eecms, #events, #releases