codefog / contao-widget_tree_picker Goto Github PK
View Code? Open in Web Editor NEWContao widget that behaves similar to the page or file picker but allows you to choose any table as the source.
Contao widget that behaves similar to the page or file picker but allows you to choose any table as the source.
Hello,
i found the extension with the new release of news_categories. There is a marked improvement for the news categories.
In the tree view, the indentation of the entries is not true for me.
The problem is that the entry moves to the right, if the [+] or [-] comes before it. One solution would be that every entry becomes an image before, so [+], [-] or [blank]. This would correct the indentation and the tree view is displayed understandable.
Hi
I got a Php error (see below) while trying to migrate my local Contao installation to live server.
If I understand well, it seems to be a problem with Tree picker extension.
I downgraded my Contao version to 3.5.13 in order to make sure WTP 2.3.0 is compliant, but it still doesn't work properly.
Please note I need this widget cause I want to use the News Category extension.
I managed to migrate my installation deleting both News Category and Tree Picker from local and reinstalling them from live, but I obviously lost all my settings...
Here's the error log i got when trying to launch the contao/install.php tool:
any idea?
Thanks in advance
Warning: mysqli::real_connect(): (28000/1045): Access denied for user 'root'@'localhost' (using password: NO) in system/modules/core/library/Contao/Database/Mysqli.php on line 46
#0 [internal function]: __error(2, 'mysqli::real_co...', '/home/www/clien...', 46, Array)
#1 system/modules/core/library/Contao/Database/Mysqli.php(46): mysqli->real_connect('localhost', 'root', '', 'database', 3306, '')
#2 system/modules/core/library/Contao/Database.php(81): Contao\Database\Mysqli->connect()
#3 system/modules/core/library/Contao/Database.php(165): Contao\Database->__construct(Array)
#4 [internal function]: Contao\Database::getInstance()
#5 system/modules/core/library/Contao/System.php(140): call_user_func(Array)
#6 system/modules/core/classes/Backend.php(30): Contao\System->import('Database')
#7 system/modules/core/library/Contao/System.php(140): Contao\Backend->__construct()
#8 system/modules/core/library/Contao/Template.php(272): Contao\System->import('TreePicker\\Tree...')
#9 system/modules/core/classes/BackendTemplate.php(34): Contao\Template->parse()
#10 system/modules/core/classes/BackendTemplate.php(107): Contao\BackendTemplate->parse()
#11 system/modules/core/controllers/BackendInstall.php(878): Contao\BackendTemplate->output()
#12 system/modules/core/controllers/BackendInstall.php(107): Contao\BackendInstall->outputAndExit()
#13 contao/install.php(24): Contao\BackendInstall->run()
#14 {main}
Fatal error: Uncaught exception Exception with message Access denied for user 'root'@'localhost' (using password: NO) thrown in system/modules/core/library/Contao/Database/Mysqli.php on line 50
#0 system/modules/core/library/Contao/Database.php(81): Contao\Database\Mysqli->connect()
#1 system/modules/core/library/Contao/Database.php(165): Contao\Database->__construct(Array)
#2 [internal function]: Contao\Database::getInstance()
#3 system/modules/core/library/Contao/System.php(140): call_user_func(Array)
#4 system/modules/core/classes/Backend.php(30): Contao\System->import('Database')
#5 system/modules/core/library/Contao/System.php(140): Contao\Backend->__construct()
#6 system/modules/core/library/Contao/Template.php(272): Contao\System->import('TreePicker\\Tree...')
#7 system/modules/core/classes/BackendTemplate.php(34): Contao\Template->parse()
#8 system/modules/core/classes/BackendTemplate.php(107): Contao\BackendTemplate->parse()
#9 system/modules/core/controllers/BackendInstall.php(878): Contao\BackendTemplate->output()
#10 system/modules/core/controllers/BackendInstall.php(107): Contao\BackendInstall->outputAndExit()
#11 contao/install.php(24): Contao\BackendInstall->run()
#12 {main}
When i install this in contao 3.5.2 comes no matching package found.
Prerequisites:
If you have a category, that contains a sub category, but in the list view the main category is "closed":
and then you open it, it will look like this:
instead of this:
I think the reason is because the AJAX response contains a (plain text) <?php
for some reason:
<?php <li class="tl_file click2edit toggle_select hover-div cf"><div class="tl_left" style="padding-left:20px"><img src="assets/contao/images/iconPLAIN.svg" width="18" height="18" alt="" style="vertical-align:text-top;margin-left:20px"> Sub Category <span style="padding-left:3px;color:#b3b3b3;"></span></div> <div class="tl_right"><a href="contao?do=news&table=tl_news_category&act=edit&id=2&rt=…&ref=SFaQ0VQ8" title="Kategorie ID 2 bearbeiten" class="edit"><img src="system/themes/flexible/icons/edit.svg" width="16" height="16" alt="Kategorie bearbeiten"></a> <a href="contao?do=news&table=tl_news_category&act=paste&mode=copy&id=2&rt=…&ref=SFaQ0VQ8" title="Kopiert die Kategorie ID 2" class="copy" onclick="Backend.getScrollOffset()"><img src="system/themes/flexible/icons/copy.svg" width="16" height="16" alt="Kategorie kopieren"></a> <a href="contao?do=news&table=tl_news_category&act=paste&mode=copy&childs=1&id=2&rt=…&ref=SFaQ0VQ8" title="Kopiert die Kategorie ID 2 mit den Unterkatehgorien" class="copyChilds" onclick="Backend.getScrollOffset()"><img src="system/themes/flexible/icons/copychilds.svg" width="16" height="16" alt="Unterkategorien kopieren"></a> <a href="contao?do=news&table=tl_news_category&act=paste&mode=cut&id=2&rt=…&ref=SFaQ0VQ8" title="Kategorie ID 2 verschieben" class="cut" onclick="Backend.getScrollOffset()"><img src="system/themes/flexible/icons/cut.svg" width="16" height="16" alt="Kategorie verschieben"></a> <a href="contao?do=news&table=tl_news_category&act=delete&id=2&rt=…&ref=SFaQ0VQ8" title="Löscht die Kategorie ID 2" class="delete" onclick="if(!confirm('Soll der Eintrag ID 2 wirklich gelöscht werden?'))return false;Backend.getScrollOffset()"><img src="system/themes/flexible/icons/delete.svg" width="16" height="16" alt="Kategorie löschen"></a> <a href="contao?do=news&table=tl_news_category&act=show&id=2&popup=1&rt=…&ref=SFaQ0VQ8" title="Zeigt die Details der Kategorie ID 2" onclick="Backend.openModalIframe({'title':'Zeigt die Details der Kategorie ID 2','url':this.href});return false" class="show"><img src="system/themes/flexible/icons/show.svg" width="16" height="16" alt="Details der Kategorie"></a> <a data-haste-ajax-operation-value="1" data-haste-ajax-operation-name="toggle" href="contao?do=news&table=tl_news_category&rt=…&ref=SFaQ0VQ8" title="Kategorie ID 2 veröffentlichen/unveröffentlichen" class="toggle" onclick="return Haste.toggleAjaxOperation(this, 2);Backend.getScrollOffset();"><img src="system/themes/flexible/icons/visible.svg" width="16" height="16" alt="Kategorie veröffentlichen/unveröffentlichen"></a></div></li>
The change from #4 made the extension incompatible with older Contao versions. The line
var inp = frm.document.getElementById('tl_select').getElementsByTagName('input');
causes
TypeError: h.document.getElementById(...) is null
under Contao 3.2 when trying to select and apply a category from the extension codefog/contao-news_categories, since there is no HTML Element with the ID tl_select
in the iframe of the tree selector.
This is because under Contao 3.5 the HTML element has the ID tl_select
while in Contao 3.2 for instance the HTML element has the ID tl_listing
.
Unfortunately, I get an error when I try to restrict the categories in a news archive. Can I resolve it by myself? Thank you.
Fatal error: require_once(): Failed opening required '../../../initialize.php' (include_path='.:/usr/lib/php5.6') in /homepages/18/d42828063/htdocs/subdomains/babymanufactur/composer/vendor/contao-legacy/widget_tree_picker/TL_ROOT/system/modules/widget_tree_picker/public/treepicker.php on line 26
The Cetegory-Picker from News-Categrories is showing up like this. No selection possible.
There are errors in the console and in the error-log, but I am not able to see the real cause. Do you have an idea?
Console:
Uncaught SyntaxError: Unexpected token <
in /system/modules/widget_tree_picker/public/treepicker.php/assets/js/a94bfa453d23.js:1
Uncaught ReferenceError: Locale is not defined
in /system/modules/widget_tree_picker/public/treepicker.php:17
Uncaught SyntaxError: Unexpected token <
in /system/modules/widget_tree_picker/public/treepicker.php/system/modules/widget_tree_picker/assets/treepicker.min.js:1
Uncaught ReferenceError: Theme is not defined
in /system/modules/widget_tree_picker/public/treepicker.php:40
Error-Log:
PHP Fatal error: Uncaught exception 'Exception' with message 'The table name must not be empty' thrown in /html/contao/system/modules/core/library/Contao/DcaLoader.php on line 48
#0 /html/contao/system/modules/core/library/Contao/Controller.php(1297): Contao\DcaLoader->__construct(NULL)
#1 /html/contao/system/modules/widget_tree_picker/public/treepicker.php(97): Contao\Controller::loadDataContainer(NULL)
#2 /html/contao/system/modules/widget_tree_picker/public/treepicker.php(141): TreePicker\TreePicker->run()
Contao 3.5.11
widget_tree_picker 2.3.0
news_categories 2.7.2
Installation via ER2 and also manually
Changing the line https://github.com/codefog/contao-widget_tree_picker/blob/master/public/treepicker.php#L100 into $this->Template->base = \Environment::get('url');
fixes the extension for Contao 3.3
Hi, I just updated a Contao to 4.13.6 on PHP 8.0.16 and an extension which I use also uses the contao-widget_tree_picker.
I got some errors in the backend and tried to fix them:
Warning: Trying to access array offset on value of type null in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/classes/TreePickerHelper.php on line 76 Warning: Undefined array key "breadcrumb" in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/public/treepicker.php on line 122 Warning: Undefined array key "encrypt" in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/classes/TreePickerHelper.php on line 50 Warning: Undefined array key "flag" in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/classes/TreePickerHelper.php on line 66 Warning: Undefined array key "maxCharacters" in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/classes/TreePickerHelper.php on line 83 Warning: Undefined array key "parentsUnselectable" in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/widgets/WidgetTreeSelector.php on line 426 Warning: Undefined array key "reference" in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/classes/TreePickerHelper.php on line 76 Warning: Undefined array key "rootNodes" in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/widgets/WidgetTreeSelector.php on line 233 Warning: Undefined array key "selectParents" in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/widgets/WidgetTreeSelector.php on line 426 Warning: Undefined array key "sp_filter_product" in /home/www/contao_update/vendor/fast-media/contao-simple-products-extended/dca/tl_product.php on line 472 Warning: Undefined array key 6 in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/widgets/WidgetTreeSelector.php on line 389 Warning: Undefined array key 15 in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/widgets/WidgetTreeSelector.php on line 389
The only error I couldn't fix was the last one:
Warning: Undefined array key 15 in /home/www/contao_update/vendor/codefog/contao-widget_tree_picker/widgets/WidgetTreeSelector.php on line 389
May be you can use my fixes and can help me with the last one?
Hi, there is a bug in Version 2.0.1
TreePickerHelper.php line 121:
The settings show the manager in every popup in Contao Backend, e.g. in contao/main.php?do=news -> click on the blue info button. This shows a link "Zurück zur Auswahl" under the main_headline. It is very confusing
Hi,
I've got a problem if I want to use the tree picker for the contao news table. I would like to use your extension in combination with the "rocksolid custom elements" extension.
So the relevant code part looks like that:
...
'fields' => array(
'test' => array(
'label' => array('Test Tree', ''),
'inputType' => 'treePicker',
'eval' => array(
'foreignTable' => 'tl_news',
'titleField' => 'headline',
'searchField' => 'headline',
'managerHref' => 'do=news&table=tl_news',
'fieldType' => 'checkbox',
'multiple' => true,
)
),
...
In the end there is a button to get the tree view popup. That fine. But within that popup there is is the following message:
Fatal error: Uncaught exception Exception with message Query error: Unknown column 'sorting' in 'order clause' (SELECT id FROM tl_news WHERE pid=0 ORDER BY sorting) thrown in system/modules/core/library/Contao/Database/Statement.php on line 283
#0 system/modules/core/library/Contao/Database/Statement.php(254): Contao\Database\Statement->query()
#1 system/modules/widget_tree_picker/widgets/WidgetTreeSelector.php(248): Contao\Database\Statement->execute(0)
#2 system/modules/widget_tree_picker/public/treepicker.php(98): TreePicker\WidgetTreeSelector->generate()
#3 system/modules/widget_tree_picker/public/treepicker.php(128): TreePicker\TreePicker->run()
#4 {main}
The table "tl_news" and the field "headline" definitely exists. So I couldn't see where I made the mistake. Or is there anything else in contao I have to change?
(sorry for my terrible english, i hope you could understand what I want to describe)
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.