processwire / processwire-issues

ProcessWire issue reports.
45 stars 2 forks source link

PageLabelField with Template » Wrong Dropdown Display #726

Closed noelboss closed 5 years ago

noelboss commented 6 years ago

Short description of the issue

When defining a special PageLabelField in a Template, and using an Icon, the font-awesome icon code is displayed additionaly to the page-label in menu dropdowns

Expected behavior

The font-awesom icon code should not appear.

Page Label in Template:

screenshot 2018-10-15 at 15 45 53

Wrong Dropdown:

screenshot 2018-10-15 at 15 46 55

Correct Dropdown (no PageLabelField defined)

screenshot 2018-10-15 at 15 45 30

Setup/Environment

Server Details

Software Version
ProcessWire 3.0.116
PHP 7.2.11
Webserver Apache
MySQL 5.5.60-MariaDB
Server Settings |Parameter|Value| |------:|:-------| |allow_url_fopen|1| |max_execution_time|120 (changeable)| |max_input_nesting_level|64| |max_input_time|120| |max_input_vars|20000| |memory_limit|-1| |post_max_size|16G| |upload_max_filesize|10G| |xdebug|| |xdebug.max_nesting_level|| |mod_rewrite|1| |mod_security|| |GD|bundled (2.1.0 compatible)| |GIF|1| |JPG|1| |PNG|1| |EXIF Support|1| |FreeType|1| |Imagick Extension|1|
Module Details |Module ClassName|Version| |------:|:-------| |AdminHelp|1.0.9| |AdminHelpTab|1.0.8| |AdminOnSteroids|2.0.4| |AdminPageFieldEditLinks|3.1.2| |AdminThemeBoss|0.4.0| |BatchChildEditor|1.8.13| |BreadcrumbDropdowns|0.1.10| |ConnectPageFields|0.2.1| |CronjobDatabaseBackup|1.1.5| |FieldtypeAssistedURL|1.0.0| |FieldtypeFieldsetGroup|0.0.2| |FieldtypeFunctional|0.0.1| |FieldtypeMultiplier|0.1.1| |FieldtypeRepeaterMatrix|0.0.4| |FieldtypeRuntimeMarkup|0.0.2| |FieldtypeTable|0.1.5| |FieldtypeTemplates|1.0.0| |FieldtypeTextareas|0.0.7| |FormBuilder|0.3.4| |FrontEndEditLightbox|1.4.0| |IcfAttachments|0.0.1| |IcfAuthor|0.0.1| |IcfDownloads|0.0.1| |IcfFeaturedImage|0.0.2| |IcfFormFeedback|0.0.1| |IcfFormSec|0.0.1| |IcfOauth2Login|0.1.0| |IcfProcessInvite|0.0.1| |IcfProcessInviteRequest|0.0.1| |IcfRangeDownload|0.0.1| |IcfResource|0.0.1| |IcfTemplate|0.0.1| |IcfUtil|0.0.1| |InputfieldAssistedURL|1.0.1| |InputfieldChosenSelect|1.2.3| |InputfieldChosenSelectMultiple|1.1.9| |InputfieldFormBuilderFile|0.0.2| |InputfieldFunctional|0.0.1| |InputfieldMultiplier|0.1.1| |InputfieldRepeaterMatrix|0.0.4| |InputfieldRuntimeMarkup|0.0.2| |InputfieldTable|0.1.5| |InputfieldTextareas|0.0.7| |LoginRegister|0.0.2| |LoginWithEmail|0.0.3| |ModuleSettingsImportExport|0.2.9| |PageimageRemoveVariations|0.0.4| |ProcessAdminHelp|1.0.8| |ProcessChildrenCsvExport|1.8.13| |ProcessForgotPassword|1.0.2| |ProcessFormBuilder|0.3.4| |ProcessSetupPageName|2.1.0| |ProcessWireUpgrade|0.0.7| |ProcessWireUpgradeCheck|0.0.7| |TextformatterMakeLinks|1.0.0| |TextformatterTagParser|2.2.0| |TracyDebugger|4.12.4| |WireMailMandrill|0.0.1| |TextformatterOEmbed|2.0.2| |IcfAuth|0.0.2| |TextformatterVideoEmbedOptions|0.3.6|
rolandtoth commented 6 years ago

Just in case, could try it with AdminOnSteroids switched off?

Update: I see the issue with AdminOnSteroids ON too, even when setting the icon via its PageListTweaks submodule.

daun commented 6 years ago

I can confirm this on 3.0.116 and have noticed it on earlier releases as well.

This is what I could gather so far:

When defining the label fields without curly braces, the icons work as intended: title date

Once you add curly braces, the font-awesome code is displayed as text: {title} ({date})

Another, related issue I stumbled upon:

When I define the labels without braces (title date), the page dropdown doesn't apply output formatting and shows dates as UNIX timestamps (see first screenshot below). Once I define them with braces ({title} ({date})), the dates are formatted correctly according to the datetime field settings (see second screenshot below).

screen shot 2018-10-15 at 17 46 44 screen shot 2018-10-15 at 17 48 04
ryancramerdesign commented 5 years ago

Thanks, I've pushed a fix for this issue.

netcarver commented 5 years ago

@noelboss Can this be closed now?

daun commented 5 years ago

Just tried it out on 3.0.125, the icons work fine but it seems any spaces between label fields are collapsed.

E.g., defining the label fields as title abbreviation will remove the space between them — both in the page list as well as in the page dropdown. I would expect a space between fields as the default behaviour here.

screenshot 2019-02-06 at 12 18 40 screenshot 2019-02-06 at 12 18 52

Should I go ahead and open another issue since this doesn't concern the original issue about fontawesome icon display?

netcarver commented 5 years ago

@philippdaun Thank you, re-labelling as "work in progress".

netcarver commented 5 years ago

@ryancramerdesign Bumping this for your further consideration.

ryancramerdesign commented 5 years ago

Just tried it out on 3.0.125, the icons work fine but it seems any spaces between label fields are collapsed.

@philippdaun @netcarver I can't duplicate this one. I'm testing on the current dev branch (3.0.128) though am not aware of any related changes between 3.0.125 and 3.0.128. When you use just field names (without the curly brackets) it separates each field with a comma followed by a space. It sounds like something is overriding that behavior. Can you think of anything installed that might be overriding it? (module or hook)

daun commented 5 years ago

@ryancramerdesign The issue seems to be in the page tree dropdown in the main nav bar. The page list itself looks fine on 3.0.125.

Screenshot 2019-04-02 at 16 18 16

The markup looks like this, so I'd suspect the spaces are being swallowed somewhere along the line. (It should be between Schottenfeldgasse and SFG)

<a href="/admin/page/edit/?id=1135" class="">
    <i class="ui-priority-secondary fa fa-fw fa-cube"></i> Dachgeschossausbau SchottenfeldgasseSFG &nbsp; 
</a>
ryancramerdesign commented 5 years ago

Thanks @philippdaun I was just looking in the wrong place (PageList rather than Tree). I see what you are talking about now and have just pushed a fix.