e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
322 stars 214 forks source link

USER_EUF shortcode is not working with field database type #5042

Open Jimmi08 opened 1 year ago

Jimmi08 commented 1 year ago

Bug Description

UEF database type is not rendered in admin area and with single USER_EUF shortcode. It is rendered with {USER_EXTENDED_ALL} shortcode

How to Reproduce

Steps to reproduce the behavior:

  1. Add custom field f.e. test, set database type and select f.e. news_category table.
  2. Add to user and select something
  3. In admin area add it as user column - nothing is displayed
  4. add shortcode to user_template f.e. ` *** here: {USER_EUF: field=test}
                {USER_EXTENDED_ALL}`

Expected Behavior

A clear and concise description of what you expected to happen.

Screenshots

UEF: image

admin column display nothing image

user profile display nothing, only second all shortcode data are displayed (to check it isset correctly)

image

PHP Version

PHP 7.4

The reason for frontend:

            case EUF_DB_FIELD :        // check for db_lookup type
                if(!isset($fieldname))
                {
                    return null;
                }

                $structValues = $this->getFieldValues($fieldname);

$fieldname is not set at all.

Attempt to fix: added 3rd parameter return $ext->renderValue($val,$type, $fld); + public function renderValue($value, $type=null, $fieldname = '') It worked. No idea if it changes something for other types.