Results 1 to 2 of 2

Thread: Problem with items selection from database

  1. #1
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Problem with items selection from database

    When I want the items in a selectbox to be taken from the database I get to see the column nr (the place it has in the db structure) only in the tree structure. It should be taking the name of the column instead. I did a quick fix, no time to check it in other places, nor to see if this is already a known issue...

    \system\modules\catalog\dca\tl_catalog_fields.php
    Code:
    	public function getTableFields(DataContainer $dc)
    	{
    		$objTable = $this->Database->prepare("SELECT itemTable FROM tl_catalog_fields WHERE id=?")
    				->limit(1)
    				->execute($dc->id);
    		 
    		if ($objTable->numRows > 0 && $this->Database->tableExists($objTable->itemTable))
    		{
    			$fields = $this->Database->listFields($objTable->itemTable);
    
    // Fix start:
    			$arrReturn = array();
    			foreach($fields as $field) {
    				$arrReturn[$field['name']] = $field['name'];
    			}
    			return $arrReturn;
    // Fix end;			
    			return array_map(create_function('$x', 'return $x["name"];'), $fields);
    		}
    	}

  2. #2
    User MacKP's Avatar
    Join Date
    06-19-09.
    Location
    Duisburg (Germany)
    Posts
    211

    Default Re: Problem with items selection from database

    Hi Ruud,
    can you report this in the Ticket System please?

    http://www.contao-forge.org/projects/catalog/issues

    regards
    Mediendepot Ruhr
    For real-time chat the (inofficial) Chatroom in IRC:
    -> irc.freenode.net #contao | irc.freenode.net #contao.de

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •