Skip to content

Entries with url_title of "n" not displaying #337

Closed

Description

@ic360-com

Description of the problem
I've found that trying out a specific Entries' data, whose url_title is "n" isn't working.
I need to use this url_title as it relates to the North London postcode region.

How To Reproduce
{exp:channel:entries channel="postcode" url_title="n" dynamic="no"}
{title}
{/exp:channel:entries}

Error Messages
Just a blank output.

Environment Details:

  • Version: 5.3.0
  • PHP Version 7.1

Activity

  1. Havsvik commented on Dec 19, 2019

    @Havsvik

    Seems like 'n' is changed to 'no' in the database query.

    Small hack: Try adding a |, like url_title="n|", it should now be treated as an array in the database query, and is not changed to 'no' :)

    {exp:channel:entries channel="app_content" url_title="n|" dynamic="no"}
    {title}
    {/exp:channel:entries}
    

    Hope this helps!

  2. ic360-com commented on Dec 20, 2019

    @ic360-com
    Author

    Hi Havsviik,
    An interesting workaround. Yes, that has worked for me. :-)
    Hopefully this is something they can fix in the core EE software though.
    Best wishes.

  3. litzinger commented on Jan 6, 2020

    @litzinger
    Contributor

    This is actually an issue with ee()->TMPL->fetch_param(), not the database query.

    public function fetch_param($which, $default = FALSE)
    	{
    		if ( ! isset($this->tagparams[$which]))
    		{
    			return $default;
    		}
    		else
    		{
    			// Making yes/no tag parameters consistent.  No "y/n" or "on/off".
    			switch($this->tagparams[$which])
    			{
    				case 'y'	:
    				case 'on'	:
    					return 'yes';
    				break;
    				case 'n'	:
    				case 'off'	:
    					return 'no';
    				break;
    				default		:
    					return $this->tagparams[$which];
    				break;
    			}
    		}
    	}
    

    Originating, I think, from this conditional in mod.channel.php

    if ($url_title = ee()->TMPL->fetch_param('url_title'))
    		{
    			$sql .= ee()->functions->sql_andor_string($url_title, 't.url_title').' ';
    		}
    

    If I were fixing this I would add an array of ignored parameters in the fetch_param method and just return the original value and skip that switch statement.

    if (in_array($which, ['url_title']) {
        return $this->tagparams[$which];
    }
    
  4. ic360-com commented on Jan 20, 2020

    @ic360-com
    Author

    Thanks Brian - this is way out of my skillset, so hopefully a fix (or something) can be included in a future EE update. :-)

  5. added a commit that references this issue on Mar 24, 2020
    8394bea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions