[cv6] Custom Field Extension

[cv6] Custom Field Extension 1.1.0 Release Candidate 3

No permission to download
Hi all. I am back on this project. Started to port in to XF 2.3.

@SpecialK with every image, did you checked a small one?
Also, should note that this only happens when actually trying to post the thread. The image uploads and is processed just fine. Only when hitting the "Post Thread" button is the error generated.
 
I took a quick glance. The problem is that xf_cv6_custom_image.field_source has a max length of 25 characters. But the code isn't truncating the field source or checking to make sure it meets that length requirement. In my test thread, the string that it's trying to insert is 26 characters long - thread-node-329-user-40409 - so that's the issue. For now, increasing the column width to 50 fixed the issue but a permanent fix should be investigated and implemented.
 
Hi all. I am back on this project. Started to port in to XF 2.3.
@Hoffi Any news on the udpate? I'm using RC2 on XF 2.3.6 and every time a member visits "Account Details", I get this server error:

Code:
[LIST]
[*]               
[*]XF\CssRenderException: Error rendering template public:cv6_customfields.less: variable @fa-var-search is undefined in file public:cv6_customfields.less in public:cv6_customfields.less in public:cv6_customfields.less (on or near line 1)
[*]              
[*]src/XF/CssRenderException.php:89
[*]           
[/LIST]
          
[LIST]
[*]               
[*]Generated by: Unknown account
[*]              
[*]Apr 25, 2025 at 5:20 AM
[*]           
[/LIST]
       
      
[HEADING=2]Stack trace[/HEADING]
      
           
*1*| // Note that this file should never output any CSS directly. It should contain variables and mixins only.
 2 | // Output should go into core.less.
 3 |
 4 | // ################################ VARIABLES ###############################
------------

#0 src/XF/CssRenderer.php(435): XF\CssRenderException::createFromLessException(Object(Less_Exception_Compiler), 'public:cv6_cust...', '// Note that th...')
#1 src/XF/CssRenderer.php(371): XF\CssRenderer->renderToCss('public:cv6_cust...', '// Note that th...')
#2 src/XF/CssRenderer.php(279): XF\CssRenderer->renderTemplate('public:cv6_cust...', NULL)
#3 src/XF/CssRenderer.php(135): XF\CssRenderer->renderTemplates(Array, Array, Array)
#4 src/XF/CssWriter.php(60): XF\CssRenderer->render(Array)
#5 css.php(32): XF\CssWriter->run(Array, 12, 1, 'fa9c3c122c79e68...')
#6 {main}

-------------

Previous Less_Exception_Compiler: variable @fa-var-search is undefined in file anonymous-file-279.less in anonymous-file-279.less in anonymous-file-279.less - src/vendor/oyejorge/less.php/lib/Less/Tree/Mixin/Call.php:130
#0 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(147): Less_Tree_Mixin_Call->compile(Object(Less_Environment))
#1 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(90): Less_Tree_Ruleset->EvalMixinCalls(Object(Less_Tree_Ruleset), Object(Less_Environment), 18)
#2 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(95): Less_Tree_Ruleset->compile(Object(Less_Environment))
#3 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(95): Less_Tree_Ruleset->compile(Object(Less_Environment))
#4 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(95): Less_Tree_Ruleset->compile(Object(Less_Environment))
#5 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(95): Less_Tree_Ruleset->compile(Object(Less_Environment))
#6 src/vendor/oyejorge/less.php/lib/Less/Parser.php(181): Less_Tree_Ruleset->compile(Object(Less_Environment))
#7 src/XF/CssRenderer.php(431): Less_Parser->getCss()
#8 src/XF/CssRenderer.php(371): XF\CssRenderer->renderToCss('public:cv6_cust...', '// Note that th...')
#9 src/XF/CssRenderer.php(279): XF\CssRenderer->renderTemplate('public:cv6_cust...', NULL)
#10 src/XF/CssRenderer.php(135): XF\CssRenderer->renderTemplates(Array, Array, Array)
#11 src/XF/CssWriter.php(60): XF\CssRenderer->render(Array)
#12 css.php(32): XF\CssWriter->run(Array, 12, 1, 'fa9c3c122c79e68...')
#13 {main}
       
      
[HEADING=2]Request state[/HEADING]
      
           
array(4) {
  ["url"] => string(221) "/css.php?css=public%3Aalnb_navigation.less%2Cpublic%3Acv6_customfields.less%2Cpublic%3Aeditor.less%2Cpublic%3AsvAlertImprovements.less%2Cpublic%3Aextra.less&s=12&l=1&d=1745575578&k=fa9c3c122c79e68c2e7e1dd9cf80f3752b4a69bd"
  ["referrer"] => string(48) "https://xxxxx.com/account/account-details"
  ["_GET"] => array(5) {
    ["css"] => string(125) "public:alnb_navigation.less,public:cv6_customfields.less,public:editor.less,public:svAlertImprovements.less,public:extra.less"
    ["s"] => string(2) "12"
    ["l"] => string(1) "1"
    ["d"] => string(10) "1745575578"
    ["k"] => string(40) "fa9c3c122c79e68c2e7e1dd9cf80f3752b4a69bd"
  }
  ["_POST"] => array(0) {
  }
}

Any ideas? It's not too big a deal, and doesn't seem to affect anything, but still... :)
 
For those who are getting that error about the undefined @fa-var-seach variable... I spent some time with ChatGPT to work through this issue and make some modifications to fix it. Until formally fixed in the addon, here's what I did. It doesn't seem to have negative side effects currently. I'm on Xenforo 2.3.7 (working on upgrading it and addons, as I've been behind for a year or so). Hopefully this will help anyone else.

[cv6] Custom Fields + XF 2.3 (FA6) – Quick Fix for Yellow CSS Errors about @fa-var-search

----------------------------------------------------
Template Modifications
----------------------------------------------------

Target template: public:cv6_customfields.less

1) Guard mixin
• Execution Order: 10
• Search (regex): #\A#
• Replace:
/* Custom cv6: guard mixin for optional overlay icon */​
.-custom-cv6-icon-guard() {​
@iconVar: @xf-cv6OverlayIcon;​
.-custom-cv6-icon-guard-impl(@iconVar);​
}​
.-custom-cv6-icon-guard-impl(@v) when (isstring(@v)) and not (@v = ~"") {​
.cv6-IconVar(@v);​
}​
$0​


2) Rewrite .cv6-IconVar
• Execution Order: 20
• Search (regex): #\.cv6-IconVar\s*\(\s*([^)])\s\)\s*;#
• Replace:
.-custom-cv6-icon-guard($1);​

----------------------------------------------------
Style Property
----------------------------------------------------

Appearance → Styles → [cv6] Custom Fields → Zoom Icon
• Clear the value (leave blank)

----------------------------------------------------
Result
----------------------------------------------------

• Yellow CSS error gone
• Related Server Error Log entries gone
• Account Details page loads
 
Last edited:
For those who are getting that error about the undefined @fa-var-seach variable... I spent some time with ChatGPT to work through this issue and make some modifications to fix it. Until formally fixed in the addon, here's what I did. It doesn't seem to have negative side effects currently. I'm on Xenforo 2.3.7 (working on upgrading it and addons, as I've been behind for a year or so). Hopefully this will help anyone else.

Slight edit to the first Template Modification... the replacement content now is:

/* Custom cv6: guard mixin for optional overlay icon */

/* zero-arg form: use style property default */
.-custom-cv6-icon-guard() {
@iconVar: @xf-cv6OverlayIcon;
.-custom-cv6-icon-guard-impl(@iconVar);
}

/* one-arg form: pass through explicit icon (fa-search, 'fa-search', etc.) */
.-custom-cv6-icon-guard(@v) {
.-custom-cv6-icon-guard-impl(@v);
}

/* implementation: call original mixin only if a value is present */
.-custom-cv6-icon-guard-impl(@v) when not (@v = ~"") {
.cv6-IconVar(@v);
}
/* else do nothing */

$0

I found I still had an issue in the Admin area when creating a user there. The above replacement value for the Template Modiification took care of that, without bringing back the issue on the User Details page.
 
Back
Top Bottom