evolution-cms / evolution Goto Github PK
View Code? Open in Web Editor NEWThis project forked from modxcms/evolution
Welcome to the new evolution of MODX Evolution!
License: GNU General Public License v3.0
This project forked from modxcms/evolution
Welcome to the new evolution of MODX Evolution!
License: GNU General Public License v3.0
Now changing the parent of the resource, you can specify one of its descendants.
After this procedure, the site falls, because it can not build a tree of aliases (looped).
It would be nice to check whether the new parent is the document itself or one of its descendants, in order to avoid such situations.
Сейчас меняя родителя ресурса, можно указать одного из своих потомков.
После такой процедуры сайт падает, так как не может построить дерево алиасов (зацикливается).
Хорошо бы сделать проверку, не является ли новый родитель самим документом или одним из его потомков, что бы избежать таких ситуаций.
PR #212 решающий задачу #170 добавляет удобный вывод стека методов которые привели к ошибке. В этот вывод удобно было бы еще добавить стек вызовов сниппетов/плагинов.
Можно даже не изобретать велосипед, а подсмотреть как это реализовано в ClipperCMS методами registerEvalInfo() и unregisterEvalInfo(). Или более продвинутая версия из BolmerCMS засекающая время выполнения элементов.
Вот пример массива который на выходе создает Bolmer
Как видно, сразу видны и передаваемые параметры, и время выполнения, и кто инициатор вызова и т.д. и т.п. Остается только оформить вывод человеческим образом и будет сказка.
#1 Настройки кеширования документа
https://github.com/modxcms/evolution/blob/bugfix/manager/includes/document.parser.class.inc.php#L497
Вот это дело вынести в методб т.е. зачастую бывает ситуация, когда плагином/сниппетом влияют на GET массив и уже https://github.com/modxcms/evolution/blob/bugfix/manager/includes/document.parser.class.inc.php#L743 получается совсем не то
Вот тут https://github.com/modxcms/evolution/blob/bugfix/manager/includes/document.parser.class.inc.php#L268 подключается файл с DocumentListing, и всегда по коду он берется из массива. А что если до создания кэша/после получения кэша вызывать событие, чтобы иметь возможность модифицировать этот массив (хотя бы пока так). Это бы позволило без гемороя решать задачи с кастомизацией кеширования сайтов любых объемов. Допустим исключить из кеша служебные страницы, страницы товаров (если они являются папками) и т.д.
#3 уменьшить чуток кеш за счет переносов строк
убрать из файла https://github.com/modxcms/evolution/blob/bugfix/manager/processors/cache_sync.class.processor.php переносы строк (нахрена они в кэше). Зачастую из-за этого получается сэкономить пару КБ. Что в конечном счете всяко положительно сказывается на производительности сайта
#4) разнести по файлам кеш елементов
Я бы еще хотел видеть разнесеные по файлам кэши плагинов/сниппетов/чанков/документов и т.д.) ($this->pluginElvent/chunkCache/snippetCache/DocumentListing) и т.д.
#5 Сохранять в кеш
Для сниппетов и чанков добавить галочку: сохоранять в кэш (в базе даже есть поле cache_type)
[07.10.14, 10:18:57] Agel_Nash: а ты чанки в кэш пихать и не будешь если галочка сохранять в кэш снята.
[07.10.14, 10:19:44] Agel_Nash: Только метод getChunk нужно подправить как это в runSnippet https://github.com/modxcms/evolution/blob/bugfix/manager/includes/document.parser.class.inc.php#L2395
[07.10.14, 10:19:59] Agel_Nash: чтобы он подгружался из базы если нет чанка в кэше
[07.10.14, 10:20:32] Agel_Nash: сам подумай, зачем тебе чанк письма с сообщением об успешном заказе на странице регистрации?
[07.10.14, 10:21:02] Agel_Nash: а +1 запрос на странице оформления заказа это не так уж и долго (учитывая, что поиск идет по PrimaryKey индексу + чанков как правило не бывает больше 100)
[07.10.14, 10:21:58] Agel_Nash: Зато все чанки это распухание глобального кеша который реально и так из-за DocumentListing распухает
http://hastebin.com/vebijisufu.php
class DocumentParser{
protected $hashKey = null;
public getCacheFolder(){
return MODX_BASE_PATH."assets/cache";
}
protected getHashFile($key){
return $this->getCacheFolder()."/docid_" . $key . ".pageCache.php";
}
public function checkCache($id){
$key = $id;
if ($this->config['cache_type'] == 2) {
$key = $this->getPageHash($id);
}
$this->hashKey = null;
$this->getCacheFolder($key);
......
}
public function getPageHash($id){
$hash = '';
if (!empty($_GET)) {
// Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
ksort($params);
$hash = md5(http_build_query($params));
$tmp = $this->invokeEvent("OnWebChangePassword", array ("hash" => $hash, "id" => $id));
$hash = $tmp === false ? $id : "".$hash;
}
return $hash;
}
public function postProcess(){
$this->hashKey;
}
}
В методе DocumentObject::outputContent() есть работа с этими переменными. Но вот данные в эти переменные ни от куда не поступают.
А еще, переменная snipCode по всей видимости должна называться snippetsCode.
Checkboxes validate correct:
<input name="products[]" value="1" type="checkbox" eform="Products::1" />
<input name="products[]" value="2" type="checkbox" />
"hidden" fields/arrays do not validate the same:
<input name="products[]" value="1" type="hidden" eform="Products::1" />
<input name="products[]" value="2" type="hidden" />
Hidden-Fields like in above example should validate the same like checkboxes, not?
Этот экстендер получает IP пользователя и версию браузера. Этим нужно пользоваться в ядре. Но предварительно нужно дописать определение IP, чтобы оно было более точным. Позаимствовать алгоритм можно из файла accesscontrol.inc.php, а лучше из DocLister'a - там используется примерно такой же (только более продвинутый).
Хочется видеть IP человека, который инициировал добавление записи в лог.
After spending extensive time upgrading one of my complicated sites to the latest Evo version, I decided to change all passwords etc. to ensure a fully clean slate.
I did the usual back-up beforehand and went ahead and changed all passwords. After the manager showed the new password, I logged out as usual, closed all browser windows, cleared all cache and continued to log back into the system.
Then it happend - the password wasn't accepted "Incorrect username or password entered!" - huh huh above my head.
So - put the backup in place and started again - same happend again.
Then I started stripping the new password down in steps, this took ages sad
Eventually I found the culprit - it was an "&", adding an ampersand in the password breaks the system.
To ensure this didn't have anything to do with the upgrade I installed a fresh copy and the exact problem arose again.
Give it a try - use this as a password: 123&123 (but don't forget to do a DB backup first)
New update, new problem:
At install, if admin password contains special characters, upon first login, not excepted.
Reset pass via phpadmin to one that contains no special characters, login to manager, change password to on that does contain special characters, and with the above fix, all is fine.
What is different about how the install pass is saved verses admin?
Can we safely remove the folder flash and media?
Вот идея: раздражает порой, что находясь на каком-то из ресурсов, или чанке, или модуле (неважно где) нужно бывает очистить кеш.
Но после очистки хотелось бы увидеть либо модальное окно, либо просто алярм что кеш успешно очищен. Чтобы он обновлялся в фоне и не сбрасывал менеджера со страницы, на которой он находится.
Кеш обновился в фоне, модальное окно всплыло, менеджер его закрыл,остался на редактировании сниппета, документа,или еще чего....))
http://take.ms/h8s3n
https://www.google.com/search?q=Session+Adoption+session_regenerate_id
I do not think it's serious vulnerability, but I would like to fix it.
https://github.com/modxcms/evolution/blob/v1.2/manager/processors/login.processor.php#L198
Should insert "session_regenerate_id(true);" into this line, but it will not work. Does anyone know why?
I will not be able to log in. It seems that returning to the login screen after redirecting.
Correctly rewritten the session ID by looking at the cookie.
Hmm for me it works, can login as usual on my localhost with
session_regenerate_id(true);
$currentsessionid = session_id();
it would be really cool to have $modx object accessible as singleton (something like MOD::x()->api_method() ).
such improvement avoids use of globals.
now, to have that functional i have wrapper class around DocumentParser class, but its like hack but not a native usage.
Необходимо добавить директорию assets/cache/updater
Здравствуйте! Попробовал обновить сайт MODX EVO Custom 1.2.1-d9.1.7 -> MODX Evolution 1.3.0b (Jul 10, 2017)
Получил редирект на 404 страницу при установленном плагине evobabel. Возможно это не баг, но решил сюда написать.
Please post issues using the English language so that everyone can understand and join in in the conversation and possibly provide help
We are a multi-language community and have always used English where possible
Otherwise, the plugin will not be able to find out which group is assigned to the user.
it would be useful to have some kind of event management on plugins tab of element management, maybe in ?a=100 action, with crud for user-defined events.
Anyone want to try?
https://github.com/Nicola1971/JobScheduler
Just install with Package Manager and try
Hi there,
I encountered this problem by chance in Evo 1.1 and it is still there in 1.2. When a user is deactivated via the checkbox, he can't login and gets an error message. But when he then clicks on "forgot password", fills in the correct email address and follows the link in the email, this user is again active and can login. Although there is a little error alert after the link in the email was clicked and a reload of the login page, he can login as normal.
Is that the intended behaviour? I thought a user checked as not-active, shouldn't be able to login...
After the webAlertAndQuit event is called, a white page with text is loaded. Looks shameful and long time it seems to connect the styles from the file manager / includes / header.inc.php
После вызова события webAlertAndQuit загружается белая страница с текстом. Смотрится позорно и давно напрашивается подключение стилей из файла manager/includes/header.inc.php
На ряду с set_error_handler, было бы приятно еще централизовано отлавливать и как-то обрабатывать исключения.
This is just a hint or a please to improve the docs!
My problem:
After an upgrade from MODX 1.0.4 to 1.2 all @bindings no longer work and I don't know why. I cannot find any info in the changelog or in the issues.
Solution:
After hours of research and trail and error I found out, that all (at)bindings must be capitalized. So I change all @inherit or @select bindings to @inherit resp. @select and it works well.
need check
modxcms#1101
Есть в шаблоне конструкции вида:
submenu
}}newmenu
}}В чанке TOP_PART следующий код:
[+leftcolumn:isnotempty:then=`не пусто`:else=`пусто`+]<hr>
<@IF: [+leftcolumn:isnotempty+] >
Не пусто
<@ELSE>
Пусто
<@ENDIF>
[[if?
&is=`[+leftcolumn+]:!empty`
&then=`не пусто`
&else=`пусто`
]]
[+leftcolumn:is(`submenu`):then=`совпало с submenu`:else=`не совпало`+]
<@IF: [+leftcolumn:is(`submenu`)+] >
Совпало с submenu
<@ELSE>
Не совпало
<@ENDIF>
[[if?
&is=`[+leftcolumn+]:eq:submenu`
&then=`совпало c submenu`
&else=`не совпало`
]]
В результате предсказуемые результат получаем только в случае (1) ({{TOP_PART? &leftcolumn=submenu
}}), в остальных случаях получаем либо игнорирование условий проверки на значение, либо ошибку проверки на пустоту.
Подробнее было протестировано вот здесь:
http://modx.im/blog/questions/5293.html
Do we have to bring old issues & bugs into the new GitHub space per hand, or can that be completed through GitHub directly somehow ?
need add in docs
https://forums.modx.com/thread/99775/output-value-of-get-post-cookie-server-session
Show value $_GET, $_POST, $_COOKIE, $_SERVER and $_SESSION
[!$_GET['username'] !]
[!$_GET['username']:ifempty=
http://mng.demo.modx.jp/pack_list/Evolution/modx1015j.html
Sample
On the OnFileBrowserUpload event, when multiple files are loaded, not an array of $ filepath and $ filename of the downloaded files is returned, but only $ filepath and $ filename of the first downloaded file.
need refactor code to all time will be array )
The new theme does not support dashboard widgets.. why??
Adjusting it will make it 3 times faster.
There is even more difference in large-scale sites.
For the Extras/Store modules:
instprocessor-fast.php and instprocessor.php have end() functions that generate "PHP Strict Standards: Only variables should be passed by reference" log warnings.
Actually sabzh. I want to be able to change the point of return after doing any actions. Well, let's say, after deleting the document
If you try to duplicate a resource containing and apostrophe in the page title. Modx shows the following SQL error:
SELECT pagetitle FROM valbruna.modx_site_content WHERE pagetitle LIKE 'Duplicate Site 'offline Duplicate%'
Workaround is to remove the apostrpohe.
BBloke
Невеликий баг, но всё же.
Закинул installer.php из 1.3 в 1.2.2, обновил на develop.
Открываю шаблон, тыкаю вкладку "Назначенные TV", там ряд не-назначенных шаблону ТВ со ссылкой Редактировать.
Нажимаю Редактировать рядом с каким-либо ТВ, там нажатием кнопки "Включить все" присваиваю этот ТВ всем шаблонам, нажимаю Сохранить.
Меня возвращает на вкладку шаблона Назначенные TV (что логично), но там не отмечен ни один ТВ, хотя некоторые уже присвоены шаблону.
Перезагрузкой страницы (Shift+Ctrl+R) это не лечится, лечится заходом в редакт-е шаблона через верхнее меню, тогда все галочки на месте.
It would be great to be able to create custom fields for Manager/Web users. This thing is always missing when developing site with web users.
Admin should be able to easily add custom user fields like he is able to create TVs for templates now. Ideally, fields would be assigned to user groups.
In Revolution there is an option to add custom fields but it is not working well, because created fields applies only to the one user.
In Evolution I would like it be global for all users or organized by user groups.
I think it should be a priority feature in next release after 1.1.1
"CategorizedTabs" - one of my all time favorite plugins - works fine with "MODxRE2" but have problems with "MODxRE2 DropdownMenu" theme in 1.2.2.
Resource page is covered with mask div and TVs are not moved into tabs.
Would someone be so kind and look into it? This plugin highly depends on Javascript and DOM and there was a lot of changes in new manager dropdown theme. So there is a problem somewhere there with HTML or JS.
How it should look:
Bug:
Plugin code: https://github.com/pmfx/CategorizedTabs
BTW: To be honest it would be cool to have this plugin features in the core as system settings. This was a part of "Categories Manager" by the same author.
Question and idea for a new feature.
Would it be possible for "Image" and "File" Template Variable to have/use its own/private folders inside "assets" folder? I see it like this:
When creating new Image or File TV, a new option (checkbox) is visible called "Use private folder for uploaded files".
When this option is selected two new options appear. First "Auto folder name" (checkbox). Second "Enter path maually" (text input). "Auto folder name" would create folders like "assets/images_tv/tv_22" or "assets/files_tv/tv_22" where 22 would be TV ID.
Visuals ;)
screenshot_2
I think it would be very useful in many scenarios.
What do you think?
Warning: file_put_contents(/home/users/...../assets/cache/updater/check_12.json): failed to open stream: Нет такого файла или каталога in /home/users/....../assets/plugins/updater/plugin.updater.php on line 66
Пока просто отключил плагин Updater.
The issues list keeps growing for no reason - when an issue is resolved, please close it yourself.
Placing this extra work on the admins costs time, their time is better spent resolving issues and not closing the resolved posts
The editor has a button "Close Issue", all you have to do is press the button and the issue will be closed.
For a long time the method for obtaining time taking into account the bias in the system settings is suggested.
function getTime(){
return time() + $this->config['server_offset_time'];
}
In the code, there are often times where just time () is used, then time () + offset. This needs to be corrected.
replace getChunk method as here https://github.com/AgelxNash/DocLister/blob/master/lib/DLTemplate.class.php#L80 ? In this case we'll have no need to change snippets code to use inline templates and so on.
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.