Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modx revo 2.8.5 tamplate - available for template (tvs) doesn't save info, only checkboxes #16486

Open
Extrabash opened this issue Oct 22, 2023 · 9 comments
Labels
bug The issue in the code or project, which should be addressed.

Comments

@Extrabash
Copy link

Bug report

Summary

Modx revo 2.8.5 tamplate - available for template (tvs) doesn't save info, only checkboxes.
Nor name no order will be saved.

Step to reproduce

Go to any template, check it's template variables, try to rename one, or change sort number.
On save - checkbox will be saved, name and sort number wouldn't.

Observed behavior

Fields will stay after save.

Expected behavior

Should save new info.

Environment

MODX version 2.8.5

@Extrabash Extrabash added the bug The issue in the code or project, which should be addressed. label Oct 22, 2023
@Ruslan-Aleev
Copy link
Collaborator

Ruslan-Aleev commented Oct 22, 2023

I confirm! The name and label of the TV changes when double-clicked, BUT is not saved.
Moreover, if TV is located in a category, then problems also appear for sorting.

tvs

p.s. This is probably also true for the 3.x branch.

@halftrainedharry
Copy link
Contributor

halftrainedharry commented Oct 23, 2023

Nor name no order will be saved.

The value in the column "Rank" (Сортировка) is saved correctly, when the checkbox "Access" (Доступ) is checked.
This "Rank" value is specific to the template the TV is assigned to. If the TV is not assigned to the template, then there is no place to store the value.

$templateVarTemplate->set('rank',isset($tv['tv_rank']) ? $tv['tv_rank'] : 0);


What is the expected solution for this issue?

Just to disable the inline editing of the columns "name" and "caption" in the grid?

Here in the code:

,editor: { xtype: 'textfield' ,allowBlank: false }

Or to add the missing functionality to the update processor?

Here in the code:

foreach ($templateVariables as $id => $tv) {

@halftrainedharry
Copy link
Contributor

p.s. This is probably also true for the 3.x branch.

@Ruslan-Aleev In MODX 3, you removed the inline edition in the grid (369ea78). So I suppose this is the preferred solution for the 2.x branch as well?

@Ruslan-Aleev
Copy link
Collaborator

The value in the column "Rank" (Сортировка) is saved correctly, when the checkbox "Access" (Доступ) is checked.
This "Rank" value is specific to the template the TV is assigned to. If the TV is not assigned to the template, then there is no place to store the value.

I understand about "Access", yes. BUT, there seems to be a problem with sorting if TVs are located inside a category (not without a category, but within a separate category). Check back if you have time.

So I suppose this is the preferred solution for the 2.x branch as well?

I think yes. There is no need to add new functionality for the 2.x branch.

@halftrainedharry
Copy link
Contributor

BUT, there seems to be a problem with sorting if TVs are located inside a category (not without a category, but within a separate category).

I'm sorry, but I don't understand what you mean exactly.

Where is the sorting wrong? In the "Template Variables" tab (shown in your screenshot above) when edition a template? Or in the "Template Variables" tab of a resource?

@Ruslan-Aleev
Copy link
Collaborator

Where is the sorting wrong?

Apparently I made a mistake, I double-checked everything again - there is no error, the sorting works.

@Extrabash
Copy link
Author

One more thing - sort field is filled with nuber in tv form, but 0's in category in sort field.

image

@halftrainedharry
Copy link
Contributor

sort field is filled with nuber in tv form, but 0's in category in sort field.

These are two different values.
One is stored in the database table modx_site_tmplvars (column rank) and is set per TV.
The other is stored in the database table modx_site_tmplvar_templates (column rank) and is specific to this template. This value can be used to give the TV a different rank, if it's used in multiple templates and should appear in a different position.

@Extrabash
Copy link
Author

Ok, See now. Didn't know this one, seems totally useless))
The way to move categories attached to templates in diffetent order, that would be really useful, while building multiple pages, containing same info blocks. To have them in order as on page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue in the code or project, which should be addressed.
Projects
None yet
Development

No branches or pull requests

3 participants