spicywebau / craft-fieldlabels Goto Github PK
View Code? Open in Web Editor NEWOverride Craft CMS field labels and instructions in the field layout designer
License: MIT License
Override Craft CMS field labels and instructions in the field layout designer
License: MIT License
Thanks for the great plugin.
It seems updated field labels and instructions are only visible for admin users. Any users who are not admin see the original field title and instructions.
Is this an intentional feature of the plugin?
I've been using Project Config the past few days to keep my local and remote setups in sync. I just installed Field Labels and deployed to fortrabbit and got an error after the sync installed the plugin. See screenshot:
Running it again and I get a done
message, but in the admin I'm not seeing my relabelled fields.
Hey there! First of all thanks for this super handy plugin. Saves me from creating a bunch of one-off fields.
As of yesterday, I ran into an issue where Relabel instructions are being outputted twice. Not sure what's causing it to happen.
Using:
The data seems to have a single instance of the instruction text.
If you need any additional information, I'll be happy to provide it.
I have commerce in my vendor folder but it is not installed within craft, so when i try and install fieldlabels i get the error:
Call to a member function getProductTypes() on null
line 222: $layouts['commerceProductType'] = $this->_mapCommerceLayouts($commerce->getProductTypes()->getAllProductTypes());
in Plugin.php
Because the field layout is fixed for users, relabelling will work differently. Need to find a way to implement relabelling for user fields.
This issue looks very similar to one in the Neo repository spicywebau/craft-neo#382 but slightly different. I just made the big update on our site from Craft CMS 3.4.9 to 3.5.4. Along with the core CMS updates, I'm also updating Neo from 2.6.4 to 2.8.4 and FieldLabels from 1.1.9 to 1.3.1.
I haven't reproduced on a fresh install. But here's the gist:
Database Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'types.maxSiblingBlocks' in 'field list'
The SQL being executed was: SELECT types.fieldLayoutId, types.name, types.handle, types.maxBlocks, types.maxSiblingBlocks, types.maxChildBlocks, types.childBlocks, types.topLevel, types.sortOrder, types.uid, fields.uid AS field
FROM neoblocktypes types
INNER JOIN fields fields ON types.fieldId = fields.id
Migration: spicyweb\fieldlabels\migrations\m200812_104254_craft_3_5_field_layout_transition_part_2
Output:
Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'types.maxSiblingBlocks' in 'field list'
The SQL being executed was: SELECT types.fieldLayoutId, types.name, types.handle, types.maxBlocks, types.maxSiblingBlocks, types.maxChildBlocks, types.childBlocks, types.topLevel, types.sortOrder, types.uid, fields.uid AS field
FROM neoblocktypes types
INNER JOIN fields fields ON types.fieldId = fields.id (/site/src/vendor/yiisoft/yii2/db/Schema.php:677)
#0 /site/src/vendor/yiisoft/yii2/db/Command.php(1298): yii\db\Schema->convertException(Object(PDOException), 'SELECT types....')
#1 /site/src/vendor/yiisoft/yii2/db/Command.php(1159): yii\db\Command->internalExecute('SELECT types....')
#2 /site/src/vendor/yiisoft/yii2/db/Command.php(401): yii\db\Command->queryInternal('fetchAll', NULL)
#3 /site/src/vendor/yiisoft/yii2/db/Query.php(248): yii\db\Command->queryAll()
#4 /site/src/vendor/craftcms/cms/src/db/Query.php(152): yii\db\Query->all(NULL)
#5 /site/src/vendor/spicyweb/craft-neo/src/Plugin.php(148): craft\db\Query->all()
#6 [internal function]: benf\neo\Plugin->benf\neo{closure}(Object(craft\events\RebuildConfigEvent))
#7 /site/src/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\events\RebuildConfigEvent))
#8 /site/src/vendor/yiisoft/yii2/base/Component.php(636): yii\base\Event::trigger('craft\services\...', 'rebuild', Object(craft\events\RebuildConfigEvent))
#9 /site/src/vendor/craftcms/cms/src/services/ProjectConfig.php(1149): yii\base\Component->trigger('rebuild', Object(craft\events\RebuildConfigEvent))
#10 /site/src/vendor/spicyweb/craft-fieldlabels/src/migrations/m200812_104254_craft_3_5_field_layout_transition_part_2.php(86): craft\services\ProjectConfig->rebuild()
#11 /site/src/vendor/craftcms/cms/src/db/Migration.php(52): spicyweb\fieldlabels\migrations\m200812_104254_craft_3_5_field_layout_transition_part_2->safeUp()
#12 /site/src/vendor/craftcms/cms/src/db/MigrationManager.php(232): craft\db\Migration->up(true)
#13 /site/src/vendor/craftcms/cms/src/db/MigrationManager.php(148): craft\db\MigrationManager->migrateUp(Object(spicyweb\fieldlabels\migrations\m200812_104254_craft_3_5_field_layout_transition_part_2))
#14 /site/src/vendor/craftcms/cms/src/services/Updates.php(227): craft\db\MigrationManager->up()
#15 /site/src/vendor/craftcms/cms/src/controllers/BaseUpdaterController.php(509): craft\services\Updates->runMigrations(Array)
#16 /site/src/vendor/craftcms/cms/src/controllers/UpdaterController.php(203): craft\controllers\BaseUpdaterController->runMigrations(Array, 'restore-db')
#17 [internal function]: craft\controllers\UpdaterController->actionMigrate()
#18 /site/src/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#19 /site/src/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#20 /site/src/vendor/craftcms/cms/src/web/Controller.php(181): yii\base\Controller->runAction('migrate', Array)
#21 /site/src/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('migrate', Array)
#22 /site/src/vendor/craftcms/cms/src/web/Application.php(294): yii\base\Module->runAction('updater/migrate', Array)
#23 /site/src/vendor/craftcms/cms/src/web/Application.php(684): craft\web\Application->runAction('updater/migrate')
#24 /site/src/vendor/craftcms/cms/src/web/Application.php(247): craft\web\Application->_processUpdateLogic(Object(craft\web\Request))
#25 /site/src/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#26 /site/src/public/index.php(21): yii\base\Application->run()
#27 {main}
I'm using Entry Instructions 1.0.4 to share read-only instructions with editors on entry edit screens. Some of the instructions are longer than 256 characters.
When I use Field Labels to relabel this field type, and I enter more than 256 characters under Instructions, I get this error:
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'instructions' at row 1
As a workaround for now, I can write shorter instructions or create individual fields, but it would be great to be able to use the normal Field Labels behavior to customize a single field for different contexts!
I think this is likely a race condition, but I'm not seeing the Relabel dropdowns or instructions when I'm signed in as a super admin. It looked like the JS wasn't even being included so I dug into this a bit deeper.
The conditional in Plugin.php for !$userSession->getIsGuest()
returned false
for me (indicating that I'm a guest) even though I'm signed in.
If I change this:
$this->_includeResources();
$this->_bindEvent();
to this:
Event::on(
UrlManager::class,
UrlManager::EVENT_REGISTER_CP_URL_RULES,
function (RegisterUrlRulesEvent $event) {
$this->_includeResources();
$this->_bindEvent();
}
);
And include the correct modules:
use craft\web\UrlManager;
use craft\events\RegisterUrlRulesEvent;
Everything works as expected.
I'm thinking Craft might be indicating that I'm a guest at some point in execution and then determines I'm signed in later?
I have devMode
enabled so maybe this is influencing that path, too.
Pretty sure this is the same issue as #42 but for drafts.
A javascript exception is thrown on the admin dashboard page when you don't have the Quick Post widget enabled.
The error is located at line 22 in src/resources/js/Widgets.js
var QuickPostWidget_save = Craft.QuickPostWidget.prototype.save;
edited as I figure out more
I'm getting JavaScript console errors referencing line 119 and line 226 of FieldLabels.js
:
Uncaught TypeError: Cannot read property 'handle' of undefined
Uncaught TypeError: Cannot read property 'addItems' of undefined'
.I am also finding that I can't remove existing relabels from fields in sections. I can change them, but just deleting them and saving doesn't work - the old data comes back. Not sure if this is related, but I'm seeing the errors for the same sections where this is happening.
Parse error: syntax error, unexpected '[' in RelabelPlugin.php on line 192 on MediaTemple Grid hosting (I know... I know). Doesn't happen on my local with MAMP. Maybe an outdated PHP version (5.3.29)?
I'm unable to create a new entry from the HUD when using an Entries field.
This was the console error I got:
First off, thank you so much for this plugin. It's amazing!
When a required field that has been relabeled is not filled out and a user attempts to save the element, the default field name shows up as the error message. In the example below I have a field called "Plaintext" that I use over and over again for simple input, but use Fieldlabels to make it more appropriate for the user. When attempting to save the entry with the field empty, I see the default "Plaintext cannot be blank" instead of "Subject cannot be blank".
EDIT: Super sorry, I should have checked the closed issues first. It seems like this was reported back in 2017 with #11. Not sure if it's 100% the same or not, but if it is feel free to close.
When trying to update to Craft 3.5.4 and Field Labels 1.3.1 we are getting a migration error:
Exception: Site is missing its group ID (/Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/models/Site.php:211)
#0 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/models/Site.php(252): craft\models\Site->getGroup()
#1 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/services/ProjectConfig.php(1764): craft\models\Site->getConfig()
#2 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/services/ProjectConfig.php(1130): craft\services\ProjectConfig->_getSiteData()
#3 /Users/michaelvandorth/Sites/FTI/vendor/spicyweb/craft-fieldlabels/src/migrations/m200812_104254_craft_3_5_field_layout_transition_part_2.php(86): craft\services\ProjectConfig->rebuild()
#4 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/db/Migration.php(52): spicyweb\fieldlabels\migrations\m200812_104254_craft_3_5_field_layout_transition_part_2->safeUp()
#5 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/db/MigrationManager.php(232): craft\db\Migration->up(true)
#6 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/db/MigrationManager.php(148): craft\db\MigrationManager->migrateUp(Object(spicyweb\fieldlabels\migrations\m200812_104254_craft_3_5_field_layout_transition_part_2))
#7 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/services/Updates.php(227): craft\db\MigrationManager->up()
#8 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/console/controllers/MigrateController.php(328): craft\services\Updates->runMigrations(Array)
#9 [internal function]: craft\console\controllers\MigrateController->actionAll()
#10 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#12 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/console/Controller.php(181): yii\base\Controller->runAction('all', Array)
#13 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('all', Array)
#14 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#15 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction('migrate/all', Array)
#16 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('migrate/all', Array)
#17 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#18 /Users/michaelvandorth/Sites/FTI/craft(22): yii\base\Application->run()
#19 {main}
Exception 'craft\errors\MigrateException' with message 'An error occurred while migrating Field Labels.'
in /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/services/Updates.php:235
Stack trace:
#0 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/console/controllers/MigrateController.php(328): craft\services\Updates->runMigrations(Array)
#1 [internal function]: craft\console\controllers\MigrateController->actionAll()
#2 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#4 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/console/Controller.php(181): yii\base\Controller->runAction('all', Array)
#5 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('all', Array)
#6 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#7 /Users/michaelvandorth/Sites/FTI/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction('migrate/all', Array)
#8 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('migrate/all', Array)
#9 /Users/michaelvandorth/Sites/FTI/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#10 /Users/michaelvandorth/Sites/FTI/craft(22): yii\base\Application->run()
#11 {main}
Occasionally, when I make some changes to a Neo field with lots of blocks and several relabels, I get this error and I'm unable to save the changes to the field:
Argument 2 passed to craft\helpers\Db::idByUid() must be of the type string, null given, called in /var/app/current/vendor/spicyweb/craft-fieldlabels/src/Service.php on line 227
It doesn't seem to be triggered by the specific Neo block or field layout I was changing. The stack trace usually shows another field label. I was able to fix this once by updating Neo, but it feels like that was more of a "hit it with a hammer" fix than an actual fix. Since then, the problem has arisen again.
After updating my plugin from 1.1.1 to 1.1.2 I now see this error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column hideName in field list The SQL being executed was: SELECT id, fieldId, fieldLayoutId, name, instructions, hideName, hideInstructions, uid FROM craft_fieldlabels ORDER BY id DESC
The database table doesn't get updated with the new fields.
If I manually add the fields to the database table, it will continue with the update but I eventually get another error:
The SQL being executed was: ALTER TABLE craft_fieldlabels ADD hideName tinyint(1) NOT NULL DEFAULT FALSE AFTER instructions Migration: spicyweb\fieldlabels\migrations\m190517_093540_hide_field_headings
Site is inaccessible with database exception error.
SQLSTATE[42703]: Undefined column: 7 ERROR: column "hideName" does not exist
LINE 1: ...ieldId", "fieldLayoutId", "name", "instructions", "hideName"...
^
The SQL being executed was: SELECT "id", "fieldId", "fieldLayoutId", "name", "instructions", "hideName", "hideInstructions", "uid"
FROM "fieldlabels"
ORDER BY "id" DESC
Caused by: PDOException
SQLSTATE[42703]: Undefined column: 7 ERROR: column "hideName" does not exist
LINE 1: ...ieldId", "fieldLayoutId", "name", "instructions", "hideName"...
The re-labelled fields in 'quick post' widgets on the cp dashboard page keep their original settings and aren't re-labelled. Not sure if this is a core issue as the quick-post widgets is built-in right so doubt you can hijack the fields there. Flagging it up anyway.
Cheers
For consistency, when viewing entries on an entries listing section where a custom field has been selected to be displayed as a table column the re-labeled field name should be used rather than the actual field name.
If you delete a field that has been relabeled before "reverting" back to the original label, it makes the project.yaml crash on Craft setup.
fieldlabels.b3f5addb-352a-441d-8937-6d3e2fb37860
fieldlabels.a2b4777f-3cc0-4d14-8fe8-cd0bdf1d6416
fieldlabels.2dd65639-6087-445c-969a-3271e0d6eb04
fieldlabels.e559ceac-9995-4528-a710-91730eb2e875
fieldlabels.f87017fb-c3da-4e7e-a0e9-41a57239432c
fieldlabels.fc3a316d-cd4c-4f4b-ab12-102b63e9e38d
fieldlabels.d9768070-694f-41e6-878c-759317d63998
fieldlabels.435da481-2d29-4e40-8754-709131aa7e04
fieldlabels.8b06c658-dfdb-4b1e-a091-a90e9451ed10
fieldlabels.8a8de623-a854-476b-b9a8-8686b07d0b85
fieldlabels.642a0272-168f-4dd3-abb9-3780e6fdd804 (/home/username/Projects/craft-wet/vendor/craftcms/cms/src/services/ProjectConfig.php:970)
#0 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/services/ProjectConfig.php(441): craft\services\ProjectConfig->_applyChanges(Array)
#1 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/migrations/Install.php(1036): craft\services\ProjectConfig->applyYamlChanges()
#2 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/migrations/Install.php(73): craft\migrations\Install->insertDefaultData()
#3 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/db/Migration.php(58): craft\migrations\Install->safeUp()
#4 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/db/MigrationManager.php(239): craft\db\Migration->up(true)
#5 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/controllers/InstallController.php(161): craft\db\MigrationManager->migrateUp(Object(craft\migrations\Install))
#6 [internal function]: craft\console\controllers\InstallController->actionCraft()
#7 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#8 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#9 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#10 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Controller.php(199): yii\console\Controller->runAction('', Array)
#11 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
#12 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('install', Array)
#13 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('install', Array)
#14 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/controllers/SetupController.php(124): craft\console\Application->runAction('install')
#15 [internal function]: craft\console\controllers\SetupController->actionIndex()
#16 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#17 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#18 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#19 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Controller.php(199): yii\console\Controller->runAction('', Array)
#20 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
#21 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('setup', Array)
#22 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('setup', Array)
#23 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('setup', Array)
#24 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#25 /home/username/Projects/craft-wet/craft(22): yii\base\Application->run()
#26 {main}
Exception 'craft\errors\MigrationException' with message 'An error occurred while executing the "craft\migrations\Install migration: The following config paths could not be processed successfully:
fieldlabels.b3f5addb-352a-441d-8937-6d3e2fb37860
fieldlabels.a2b4777f-3cc0-4d14-8fe8-cd0bdf1d6416
fieldlabels.2dd65639-6087-445c-969a-3271e0d6eb04
fieldlabels.e559ceac-9995-4528-a710-91730eb2e875
fieldlabels.f87017fb-c3da-4e7e-a0e9-41a57239432c
fieldlabels.fc3a316d-cd4c-4f4b-ab12-102b63e9e38d
fieldlabels.d9768070-694f-41e6-878c-759317d63998
fieldlabels.435da481-2d29-4e40-8754-709131aa7e04
fieldlabels.8b06c658-dfdb-4b1e-a091-a90e9451ed10
fieldlabels.8a8de623-a854-476b-b9a8-8686b07d0b85
fieldlabels.642a0272-168f-4dd3-abb9-3780e6fdd804'
in /home/username/Projects/craft-wet/vendor/craftcms/cms/src/db/MigrationManager.php:256
Stack trace:
#0 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/controllers/InstallController.php(161): craft\db\MigrationManager->migrateUp(Object(craft\migrations\Install))
#1 [internal function]: craft\console\controllers\InstallController->actionCraft()
#2 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#4 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#5 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Controller.php(199): yii\console\Controller->runAction('', Array)
#6 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
#7 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('install', Array)
#8 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('install', Array)
#9 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/controllers/SetupController.php(124): craft\console\Application->runAction('install')
#10 [internal function]: craft\console\controllers\SetupController->actionIndex()
#11 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#13 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#14 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Controller.php(199): yii\console\Controller->runAction('', Array)
#15 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
#16 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('setup', Array)
#17 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('setup', Array)
#18 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('setup', Array)
#19 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#20 /home/username/Projects/craft-wet/craft(22): yii\base\Application->run()
#21 {main}
My server environment has PHP 5.3 installed. The plugin gave me the Parse error: syntax error, unexpected '[' in .../plugins/relabel/RelabelPlugin.php on line 192
error. Could it be easily made compatible? Two Craft CMS plugins recently (CategorySources and CPFieldLinks) had the same problem, and it seems all that has been required was to change array syntax (see here).
The overhauled Craft 3.5 field layout designer features in-built overriding of field names and instructions. We will need to provide a transition path to Craft 3.5 field relabelling for current users of Field Labels.
This plugin doesn't seem to be working with the latest version of Craft 3.2.0.
Currently, when a field is relabelled, the original field name is crossed out. This kind of makes it look like the field is disabled or deleted.
If there are multiple relabelled fields on a tab, it may also be hard to find a specific one.
Is it possible to show the new field label, maybe in addition to the struck out original one?
I can't revert multiple labels. I must revert one label at the time then save the entry type. The last label isn't even reversible. When I save the entry type and go back in, the relabelling is still applied. Note: The relabelled fields are on a 4th blueprint tab.
I had to remove it one by one, and the last one wouldn't revert at all so I took it out from project.yaml manually.
On updating to Craft CMS 3.1.31 and trying to save a new label we get an Undefined variable: label
This stems from:
// Trigger an `afterSaveLabel` event
if ($this->hasEventHandlers('afterSaveLabel')) {
$this->trigger('afterSaveLabel', new FieldLabelsEvent([
'label' => $label,
'isNewLabel' => $isNew,
]));
}
Starting at line 258 in /vendor/spicyweb/craft-fieldlabels/src/Service.php
.
Downgrading Craft removes the error.
This is a multisite Craft setup. Not sure that's connected.
Thanks!
I'd prefer to write everything in English. But as for my Dutch clients I always translate field labels, instructions, options in dropdowns, select lists etc. etc.
Would be great if this awesome relabel plugin also supports this by apply the same technic as Craft does.
\Craft::t('site', $label);
Hey guys, do you have a timeline when this will work with Neo?
Whenever we view a Draft version of an entry, we see the original field labels rather than the relabeled ones.
Craft CMS 2.6.2929
Relabel 0.1.3
I just noticed that when viewing the source code of my Craft login screen, the relabel plugin seems to be dumping all its JSON data there. Since this could potentially include private data that includes field names and instructions intended for admin users only, it would be great if this was excluded from the login screen and any other screens that are potentially accessible by non-admins.
See example here: http://ku.staging7.yump.com.au/admin/login
(will remove this link shortly)
I don't have time right now to submit a patch, but if there is someone else willing to, that would be great.
Simon.
Hello,
This plugin could be very useful, but unfortunately it doesn't seem to work in 2.6. Do you intend to make an update soon? Thank you!
Subject should pretty well explain it — I can see the Relabel dialog box, and it does the strikethrough effect, but on save the Relabel is lost when using on Craft Commerce Product Type field layouts.
Here is the case : I have a multilingual field, when it is not relabeled, the language tag is shown on the entry form. However when I relabel it the language tag is gone. I recorded my screen because it is not easy to describe.
Originally logged here: craftcms/cms#4138
But for consideration if P&T decide not to implement it as it seems to me this would make a lot of sense for this particular plugin.
It would be great if individual field headings could be toggled "hidden" when using the field layout designer.
For a number of fields that provide the option for placeholder text, custom select button labels (e.g. an entries, category or assets field) or in other cases when it's implied (e.g. for a blog entry there is a single rich text field), it would be great to have the option to hide the field heading. In many cases the heading can feel redundant, repetative and unnecessarily adds to the vertical height of an entry edit page.
Hi benjamminf,
Great Idea. Will this work for multilingual sites as well?
I could've sworn this plugin was working for me yesterday, but today the labels aren't being relabelled. I tried resetting my code and plugins, but it didn't make a difference.
I can still set the label and instructions for the field, and it seems to save changes properly, but the old labels still show when I go to edit an entry. The field in question is Craft's built-in Plaintext field, and the entry only has Plaintext and Redactor fields.
Added list of the active plugins I have right now. I thought it might be related to mmikkel/cp-field-inspect
because that adds a gear to the right of a label, but disabling and uninstalling it didn't help.
"angellco/spoon": "^3.3",
"barrelstrength/sprout-fields": "^3.4",
"clubstudioltd/craft-inline-svg": "^0.1",
"craftcms/aws-s3": "^1.2",
"craftcms/redactor": "^2.3",
"ether/simplemap": "^3.6",
"fruitstudios/linkit": "^1.1",
"mmikkel/cp-field-inspect": "^1.0",
"nystudio107/craft-imageoptimize": "^1.5",
"nystudio107/craft-minify": "^1.2",
"nystudio107/craft-seomatic": "^3.2",
"nystudio107/craft-templatecomments": "^1.1",
"nystudio107/craft-twigpack": "^1.1",
"spicyweb/craft-fieldlabels": "^1.1",
"spicyweb/craft-neo": "^2.4",
"studioespresso/defaulttab": "^1.3",
"supercool/tablemaker": "^2.0",
"vaersaagod/dospaces": "^1.1",
"verbb/super-table": "^2.2",
I have a section with multiple entry types. The field labels are only applied to the first entry type (lowest ID).
we’re not seeing any field relabels on the Create a new entry pages. Once the entry or draft is saved, the relabaled field titles and instructions kick-in as you would expect. Quite likely related to #42.
(Originally reported by @SimonEast - spicywebau/craft-neo#73)
Steps to reproduce:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.