An exception occurred while executing ... General error: 1 near "as": syntax error Bolt CMS - content-type

I can't update or create new contenttype 'Footer' I have this error on Bolt 3.0.11:
An exception occurred while executing 'SELECT id, as title FROM bolt_footer_fr footer_fr ORDER BY id ASC': SQLSTATE[HY000]: General error: 1 near "as": syntax error
How can I update contenttype footer?
I use SQLlite.
Here all my contenttype
home_en:
name: Home
singular_name: Home
fields: &home
title:
type: text
label: Title
group: header
name:
type: text
label: Name of the site
group: header
profession:
type: html
label: Name and profession
group: header
telephone:
type: html
label: Telephone
group: header
image:
type: image
label: Image of the header
group: header
text:
type: html
label: Text on header image
slug:
type: slug
use: title
relations:
home_fr:
multiple: false
label: Select a record
order: -id
icon_one: "fa:home"
icon_many: "fa:home"
record_template: index.twig
home_fr:
name: Accueil
singular_name: Accueil
fields: *home
icon_one: "fa-home"
icon_many: "fa:home"
relations:
home_en:
multiple: false
label: Select a record
order: -id
record_template: index.twig
section_en:
name: Section home
singular_name: Section home
fields: &sectionHome
title:
type: text
label: Section title
text:
type: html
label: Text
slug:
type: slug
uses: title
taxonomy: [ order ]
relations:
section_fr:
multiple: false
label: Select a record
order: -id
section_fr:
name: Section accueil
singular_name: Section accueil
fields: *sectionHome
taxonomy: [ order ]
relations:
section_en:
multiple: false
label: Select a record
order: -id
about_en:
name: About
singular_name: About
fields: &about
slug:
type: slug
use: title
title:
type: text
label: Title
image:
type: image
label: image of you
text:
type: html
label: text
icon_one: "fa:user"
icon_may: "fa:user"
record_template: record.twig
relations:
about_fr:
multiple: false
label: Select a record
order: -id
about_fr:
name: Qui suis-je
singular_name: Qui suis-je
fields: *about
icon_one: "fa:user"
icon_may: "fa:user"
record_template: record.twig
relations:
about_en:
multiple: false
label: Select a record
order: -id
contact_en:
name: Contact en
singular_name: contact en
fields: &contact
slug:
type: slug
use: title
title:
type: text
label: title
contact_info:
type: html
label: Contact informations
slug:
type: slug
uses: name
name:
type: text
readonly: true
default: "contact"
map:
type: geolocation
label: Map
icon_one: "fa:envelope"
icon_many: "fa:envelope"
record_template: record.twig
relations:
contact_fr:
multiple: false
label: Select a record
order: -id
contact_fr:
name: Contact fr
singular_name: contact fr
fields: *contact
icon_one: "fa:envelope"
icon_many: "fa:envelope"
record_template: record.twig
relations:
contact_en:
multiple: false
label: Select a record
order: -id
footer_en:
name: Footer
singular_name: Footer
fields: &footer
copyright:
type: html
label: Copyright
social_media:
type: html
label: Social media
relations:
footer_fr:
multiple: false
label: Select a record
order: -id
footer_fr:
name: Pied de page
singular_name: Pied de page
fields: *footer
relations:
footer_en:
multiple: false
label: Select a record
order: -id
I have this error when update to 3.2.2 (and change hyphen to underscore):
In the ContentType for 'About', the relation 'about-fr' is defined, which is not a valid ContentType. Please edit contenttypes.yml, and correct this.

it's due to the underscore in the contenttype name. It's a bug in Bolt 3.0 and 3.1. Update to 3.2 and it will work.

Related

Grav Frontend form file uploading not working properly

Created a grav frontend form with file uploading feature. Except file upload everything working fine. When i trying to upload file, getting some errors from 'form.vendor.js' and file field seems to be empty after getting error. Errors given below
form.vendor.js:5 Uncaught TypeError: Cannot read properties of undefined (reading 'trim')
at D.addedfile (form.vendor.js:5:11362)
at D.value (form.vendor.js:5:1513)
at D.value (form.vendor.js:5:25886)
at HTMLInputElement.<anonymous> (form.vendor.js:5:17561)
Form full definition given below
title: 'Job apply form'
published: true
body_classes: job-apply-main-page
cache_enable: false
visible: true
form:
name: job-apply
id: job-apply
action: ' '
fields:
-
name: job
label: Job
autocomplete: 'off'
type: text
validate:
required: false
-
name: applicantName
label: 'Name of Applicant *'
autocomplete: 'off'
type: text
validate:
required: true
message: 'Please enter the applicant name'
-
name: email
label: Email
type: email
validate:
required: false
-
name: coverletter
label: 'Cover Letter'
type: textarea
validate:
required: false
-
name: resumefile
label: Resume
placeholder: 'Upload Resume'
type: file
destination: user/data/resume
accept:
- .pdf
- .doc
- .docx
multiple: false
-
name: toEmail
label: 'Hidden Field'
type: text
outerclasses: hide-input-field
validate:
required: false
-
name: enquiry-g-recaptcha-response
label: Captcha
type: captcha
id: enquiry-captcha
outerclasses: captcha-field
recaptcha_not_validated: 'Captcha not valid!'
validate:
required: true
buttons:
-
type: submit
value: Save
process:
-
email:
subject: '{{form.value.hiddenField}}'
from: '{{ config.plugins.email.from }}'
to:
- test#gmail.com
body: '{% include ''forms/data.html.twig'' %}'
attachments:
- resumefile
-
email:
subject: '{{form.value.hiddenField}}'
from: '{{ config.plugins.email.from }}'
to:
- '{{ form.value.email }}'
body: '{% include ''forms/apply.html.twig'' with { "message": "Thank you for your Inquiry. We will get back you soon" } %}'
-
save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: txt
filename: site-enquire.txt
operation: add
body: '{% include ''forms/data.txt.twig'' %}'
attachments:
- resumefile
-
message: 'Thank you for your feedback!'
reset: true
Grav and other plugins updated to latest version
Grav v1.7.27.1
Admin v1.10.27
Form v5.1.4

ORO CRM datagrid refresh after inline edit failed by missing parameter

I have a datagrid:
datagrids:
gates-under-location-grid:
inline_editing:
enable: true
extended_entity_name: Entity\Gate
source:
type: orm
query:
select:
- g
- l
- ancestor.id as ancestorId
- ancestor.name as ancestorName
from:
- { table: Entity\Gate, alias: g }
join:
left:
- { join: g.locations, alias: l }
inner:
- { join: Entity\LocationClosure, alias: lc, conditionType: WITH, condition: 'l.id=lc.descendant' }
- { join: Entity\Location, alias: ancestor, conditionType: WITH, condition: 'ancestor=:rootLocation'}
where:
and:
- lc.ancestor=:rootLocation
bind_parameters:
rootLocation: ~
hints:
- HINT_TRANSLATABLE
columns:
name:
label: 'gate.datagrid.field.name'
align: left
locations:
label: 'gate.datagrid.field.locations'
align: left
data_name: locations
data: locations
type: twig
template: Partials/Datagrid/Gate:locations_cell_in_gate_under_location_grid.html.twig
frontend_type: html
inline_editing:
behaviour: enable_selected
editor:
view: oroform/js/app/views/editor/related-id-select-editor-view
view_options:
value_field_name: locations.name
placeholder: 'placeholder'
autocomplete_api_accessor:
class: oroentity/js/tools/entity-select-search-api-accessor
entity_name: Entity\Location
search_handler_name: locations
value_field_name: id
field_name: name
label_field_name: name
properties:
id: ~
view_link:
type: url
route: gate_view
params: [ id ]
update_link:
type: url
route: gate_update
params: [ id ]
sorters:
columns:
name: { data_name: g.name }
default:
name: ASC
filters:
columns:
name:
type: string
data_name: g.name
actions:
view:
type: navigate
label: 'common.grid.details'
link: view_link
icon: eye
update:
type: navigate
label: 'common.grid.edit'
icon: edit
link: update_link
options:
entityHint: 'gate.datagrid.entityhint'
export: true
entity_pagination: true
routerEnabled: false
The location cell editor template is in the locations_cell_in_gate_under_location_grid.html file:
{% import 'OroUIBundle::macros.html.twig' as UI %}
<span class="inline-actions-element">
{% for location in value %}
<span class="tags-container">
<a href="#" title="{{ location.name }}" class="tags-container__tag-entry">
<span>
{{ location.name }}
</span>
</a>
</span>
{% endfor %}
<span class="inline-actions-element_actions inline-actions-element_wrapper" data-role="container">
{{ UI.clientButton({
'dataUrl': path('gate_locations_update',
{
'gateId': record.rootEntity.id,
'locationId': record.getValue('ancestorId')
}),
'aCss': 'inline-actions-btn inline-actions-btn--size-s',
'iCss': 'fa-pencil',
'dataId': record.rootEntity.id,
'title' : 'Edit'|trans,
'label' : 'Edit'|trans,
'widget' : {
'type' : 'dialog',
'multiple' : false,
'reload-grid-name' : 'gates-under-location-grid',
'options' : {
'alias': 'gate_locations_update_dialog',
'stateEnabled': false,
'dialogOptions' : {
'title' : 'gate.datagrid.under_location.locations_edit_widget.title'|trans,
'allowMaximize': false,
'allowMinimize': false,
'width': 600,
'modal': true,
},
},
},
}) }}
</span>
Controller action is the following:
/**
* Shows editForm, or updates Gate with given ID
*
* #Route("/locations-edit/gate/{gateId}/location/{locationId}", name="gate_locations_update", requirements={"gateId"="\d+","locationId"="\d+"})
* #Template("Gate:locations_update.html.twig")
* #ParamConverter("gate", class="Entity\Gate", options={"id" = "gateId"})
* #ParamConverter("location", class="Entity\Location", options={"id" = "locationId"})
*
* #param Request $request
* #param Gate $gate
* #param Location $location
*
* #return array|RedirectResponse
*/
public function updateLocationsAction(Request $request, Gate $gate, Location $location)
{
$form = $this->get('form.factory')
->create(GateLocationsType::class, $gate, ['attr' => ['rootLocation' => $location]]);
return $this->get('oro_form.update_handler')
->update(
$gate,
$form,
$this->get('translator')->trans('common.processes.successful_saved'),
$request
);
}
I wanted to refresh the cell after inline edit, but since i didn't find any chance, it would be good to refresh whole datagrid.
The problem is with this solution, after cell data stored, i got the Data loading failed, try reloading the page. If the issue appears again please contact your administrator. message, and it's logged in the log file:
request.CRITICAL: Uncaught PHP Exception Oro\Bundle\DataGridBundle\Exception\InvalidArgumentException: "Cannot bind datasource parameter "rootLocation", there is no datagrid parameter with path "rootLocation"." at vendor/oro/platform/src/Oro/Bundle/DataGridBundle/Datasource/Orm/ParameterBinder.php line 164 {"exception":"[object] (Oro\\Bundle\\DataGridBundle\\Exception\\InvalidArgumentException(code: 0): Cannot bind datasource parameter \"rootLocation\", there is no datagrid parameter with path \"rootLocation\". at app/vendor/oro/platform/src/Oro/Bundle/DataGridBundle/Datasource/Orm/ParameterBinder.php:164, Symfony\\Component\\PropertyAccess\\Exception\\NoSuchPropertyException(code: 0): The key \"rootLocation\" does exist in an array. at app/vendor/oro/platform/src/Oro/Component/PropertyAccess/PropertyAccessor.php:435)"} []
I tried to add the parameters, but these efforts didn't affected on the error.
Could somebody help, how to pass the rootLocation parameter for the refresh?
Thanks in advance!
A custom controller is not a recommended way to handle the inline editing in the datagrid.
Please follow the official documentation on Creating editable data grid cells in OroPlatform applications.
Also, there is a general reference on inline editing in the OroPlatform datagrids, where you can find the documentation about all the existing inline editor options. You can use one of them, instead of implementing the custom one, or you can use it as a base for creating your own editor.

Magnolia CMS Content App Multivalue and composite field error

I am facing weird issue when using multi value and composite field in content app data is not stored in JCR properly, when used transformer class no error appears but no data is saved.
Following is my light module editor section
editor:
class: info.magnolia.editor.app.ContentEditorSubAppDescriptor
actions:
close:
class: info.magnolia.editor.action.CloseContentEditorActionDefinition
save:
class: info.magnolia.editor.action.SaveContentActionDefinition
saveAndPublish:
class: info.magnolia.editor.action.SaveContentActionDefinition
onSuccessAction:
class: info.magnolia.ui.framework.action.ActivationActionDefinition
command: activate
contentConnector:
workspace: rules
$type: jcrDatasource
nodeTypes:
- icon: icon-node-content
name: mgnl:content
strict: false
- icon: icon-folder-l
name: mgnl:folder
strict: false
contentDefinition:
outlineFields:
jcrName:
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
required: true
styleName: title
range:
class: info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition
collapsed: true
fields:
- name: rangeList
fieldType: multiValue
transformerClass: info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueFieldTransformer
label: Range1
field:
name: rangeComponent
fieldType: composite
transformerClass: info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
fields:
- name: title
fieldType: text
label: Title1
- name: title2
fieldType: text
label: Title2
equals:
class: info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition
name: equalList
collapsed: true
fields:
equals:
name: equalComponent
fieldType: multiValue
class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
buttonSelectAddLabel: field.link.select.add
field:
name: equalElement
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
fieldType: text
blocks:
- text
initialBlock: text
linkableApps:
- pages
- assets
Equal section is working as expected but range section with composite part is not storing data.
Maybe the problem is the transformerClass which you're using in multiValue field. Try with the DelegatingMultiValueSubnodeTransformer:
- name: rangeList
fieldType: multiValue
transformerClass: info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueSubnodeTransformer
label: Range1
field:
name: rangeComponent
fieldType: composite
transformerClass: info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
fields:
- name: title
fieldType: text
label: Title1
- name: title2
fieldType: text
label: Title2
Hope it helps ;)

EasyAdmin Bundle - Symfony

I work with EasyAdmin and I don't know how to add an image in list view.
I would like to add next to the prices two pictures (simply 2 logos) with a link to the website in question. The admin can click on logo A or B who redirect to the website.
I can insert my links with entiy's priority (Interface with links).
.
Here is my code:
app/config/config.yml
list:
fields:
- { property: 'low_amz', label: 'Amazon' }
- { property: 'url_amz', label: 'Amz', type: 'url' }
- { property: 'low_pm', label: 'PriceMinister' }
- { property: 'url_pm', label: 'Pm', type: 'url' }
But how I replace these link's value with my images. The images are stocked in local.
With my thumbnails, it works:
- { property: 'urlPdtImg', type: 'image', label: ' ' }
But in my case, I want just to change the value "string" in img. Of course, this does not work:
- { property: 'url_pm', label: 'Pm', type: 'url', base_path: '/img/Amazon.svg' }}
EasyAdmin Bundle 1.17.12
Symfony 3.4
Have a nice day.
Here are my files:
File config.yml:
- { property: 'url_amz', label: ' ', type: 'url', template: 'easy_admin/fields/_url1.html.twig' }
File _url.html.twig
<a href="{{ value }}">
<img src="{{ asset('Img/PM.svg') }}" alt="Amazon logo" style="height: 30px;"/>
Result

sonata don't show edit roules in dashboard

i'm a newbie of sonata, i configure in this way my config.yml
sonata_admin:
title: Name
templates:
layout: SonataAdminBundle::layout.html.twig
dashboard:
groups:
PartnerShop:
label: Partner Shop
icon: <i class="fa fa-car"></i>
items:
- admin.content
- admin.access
- admin.category
PagineComuni:
label: Pagine Comuni
icon: <i class="fa fa-bars"></i>
items:
- route: 'admin_app_comuni_edit'
route_params: { id: 1 }
label: Name
- route: 'admin_app_comuni_edit'
route_params: { id: 2 }
label: Brands
- route: 'admin_app_comuni_edit'
route_params: { id: 3 }
label: Gamma
- route: 'admin_app_comuni_edit'
route_params: { id: 4 }
label: Logistica
User:
label: Utenti
icon: <i class="fa fa-users"></i>
items:
- sonata.user.admin.user
- sonata.user.admin.group
roles: [ROLE_SUPER_ADMIN ]
in side menĂ¹ all it works, i see the correct list of admin, but in dashboard i see only the ParnerShop and User block, PagineComuni is not present
exist a way to display pagine comuni beetween ParnerShop and User?
thank you

Resources