How to increase maxitems in Menu of selected pages - typo3-7.6.x

In TYPO3 7.x in the Content Element "Special Menus"/"Menu of selected pages" the number of entries is limited to 50. If you add 51 a red exclamation mark pops up. The help (?) shows: "Select a target page or multiple target pages."
I need to add at least 60 pages and have found Bug #59523 at https://forge.typo3.org/issues/59523 related to TYPO3 6.x and a patch to increase the number from 22 in ver 6.x to 50.
I tried to manually implement the same solution in TYPO3 ver 7.x at /sysext/frontend/Configuration/TCA/tt_content.php changing 'maxitems' => '50' to 'maxitems' => '60' but it doesn't work.

Have you tried the following?
$GLOBALS['TCA']['tt_content']['columns']['pages']['config']['maxitems'] = 99;
What can be seen in module Configuration -> TCA ?

Related

Prestashop 1.7 admin theme css overrides

I am trying to modify the PS 1.7 admin theme - simply to hide a few options and menu items.
I modified ./adminFolder/themes/default/css/override.css
And it works everywhere, except at Catalog/Products and Modules - as if there were no overrides.
How can I get the css overrides to work globally in the admin area?
If you want to hide menu/sub-menus, you can set the visibility from within the database in the table [PREFIX]_tab (default is ps_tab).
The top menu has 0 for id_parent and submenus has a value superior to 0.
By example, I have this vehicle file custom module:
If I set the row with the class_name "V2vVehicleFile" to active = 0 (false), then the whole menu (including its submenus) disappear.
Now, if I set the row with the class_name "AdminVehicleMake" to active = 0 (false), then only the submenus named "Vehicle make" disappear.
The product controller is already in the new system (symfony).
Looking at the source code you can see that it uses 5 css:
/modules/welcome/public/module.css
/admin/themes/new-theme/public/theme.css
/js/jquery/plugins/chosen/jquery.chosen.css
/admin/themes/default/css/vendor/nv.d3.css
/admin/themes/default/css/bundle/right-sidebar.css
The overrides.css is only for the "old theme". And I don't know of any for the new one.
So either you change one of these, and run the risk of being overwritten on upgrade. Or override the AdminController->setMedia($isNewTheme = false) to add your custom css. Or use the Hook::exec('actionAdminControllerSetMedia'); in a module to add it.
Add the overrides.css file location to the function named setMedia in classes/controller/AdminController.php
public function setMedia($isNewTheme = false)
{
if ($isNewTheme) {
$this->addCSS(__PS_BASE_URI__ . $this->admin_webpath . '/themes/default/css/overrides.css', 'all', 1);

Use OneUI theme depending on the installed version of Domino

Based on this snippet (http://openntf.org/XSnippets.nsf/snippet.xsp?id=oneui-on-the-fly-theme-changer) I tried to calculate the theme depending on the release of Domino. I'd like to use "oneuiv2.1" on Domino<9 and "oneuiv3.0.2" on a 9 release.
EDIT: To be clear: I already can identify the version, the question is about calculating and setting the theme at the right time as my following approaches seem to do the work too late. The page renders and then the theme is set - however this is my impression.
These were my first approaches:
Calculate the theme name in the "extends" property of the theme - didn't work.
Calculate and set the value of the session property "xsp.theme" in a beforeRenderResponse and beforePageLoad event of my Xpage - this also failed
Set up a bean to calculate the value and set the session property when the bean is initialized - same result
Of cause you can calculate (render) all the needed stylesheets and scripts of OneUIv2.1 and OneUIv3 in the theme file but hey, this is quite a hassle with that amount of resources, isn't it?
So my question is: do you have any other ideas how to achieve this? This would be very handy to use if your applications can use both themes with the same layout, independent where the application runs - whether on a 8.5.x or 9 machine.
Looking forward to the discussion :-)
You can change theme on beforePageLoad event:
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
beforePageLoad='#{javascript:
var theme = session.getNotesVersion().startsWith("Release 8") ? "oneuiv2.1" : "oneuiv3.0.2";
if ( ! theme.equals(context.getSessionProperty("xsp.theme"))) {
context.setSessionProperty("xsp.theme", theme);
context.redirectToPage(context.getUrl().toSiteRelativeString(context));
}
}'>
The trick is to set session property "xsp.theme" and to redirect to same page if theme has to be changed.
redirectToPage() will happen only one time per session as Notes version won't change during session.
If you use Extension Library you can do this to look for the version of Domino:
#Left(com.ibm.xsp.extlib.util.ExtLibUtil.getExtLibVersion(), 3) == "8.5")

Magento Can't mass update attributes for Required Field Error

I’m hoping someone can shed some light on this:
I’m using the search facility in Magento to find products with a certain attribute, and then selecting those products and using the “update attributes” feature to add data to (update) a different attribute field.
In some cases, this works fine, the new attribute data is recorded and all is well. On other selections when I try and save the new attribute data it comes up with the red warning “this is a required field”. Sure enough, the field it specifies IS a required field, but as I’m not updating that particular field I’ve not ticked the check box underneath it and this field should be ignored.
If I turn off the “required field” option for the highlighted fields then the new attribute data gets saved BUT: It wipes the data in loads of the other attributes, meaning I lose valuable data from my product attributes. It seems as if it works the first couple of times I use it in a day then it spits its dummy out and comes up with the required field issue.
I’ve tried this with both Google Chrome and Firefox. As I’ve said though, sometimes it will work , sometimes it won’t . I’m selecting 20-100 products at a time. I’ve even tried selecting just one product, and can still get the same error on that one product.
I’m on Magento 1.7.0.2
I did have a similar problem with attribute data getting wiped last year when we were on 1.6 but I seem to remember it was a Magento bug which was fixed when we upgraded to a newer version.
Can anyone shed any light on why this might be happening? There’s nothing coming up in the search engines for it and its really slowing me down!
The problem is that the attributes are NOT getting disabled by default in the update attributes page, hence require a value.
Why?
Most likely due to a faulty attribute failing somewhere above your attribute.
Option 1. As I don't know what attribute or the attribute problem, hack js/mage/adminhtml/product.js and change this function to ignore the faulty attribute.
function disableFieldEditMode(fieldContainer) {
try {
$(fieldContainer).disabled = true;
if ($(fieldContainer + '_hidden')) {
$(fieldContainer + '_hidden').disabled = true;
}
}
catch(exception) {
}
}
Option 2. Remove the faulty attribute from the product (You might need to remove restrictions ).
update eav_attribute set is_user_defined = 1 where attribute_code like 'foo_bar';
Option 3. Fix the faulty attribute. In my case the offending module was AW_Onsale.
it attempted to render a nonexistent frontend model: onsale/system_entity_form_element_position
select attribute_code, frontend_model from eav_attribute where attribute_code like '%aw_os_%';
aw_os_product_position | onsale/entity_attribute_frontend_position
update eav_attribute set frontend_model = null where attribute_code like '%aw_os_product_position%';
update eav_attribute set frontend_model = null where attribute_code like '%aw_os_category_position%';

Change/remove '--Please Select--' message from Custom Option dropdown on Magento Product page

I want to change the dropdown message or remove it all together. I've searched for instances of --Please Select-- but I cannot find the one that controls the Custom Option dropdowns.
Searched high and low but I cannot find where this code lives in Magento, any help will be greatly appreciated!
The easiest way to change the text would be through translation. Open app/locale/en_US/Mage_Adminhtml.csv (or whichever language you have installed) and you'll see a row for "-- Please Select --" already there, change the text in the second column and clear the translation cache. This affects all instances of "-- Please Select --" throughout the admin.
To be more specific copy the file app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php to an equivalently named folder in app/core/local/ and either change or delete the line that looks like this:
array('value' => '', 'label' => Mage::helper('adminhtml')->__('-- Please select --'))
I had a similar issue myself and, after searching high and low, decided to take what I knew about Magento and tackle it alone.
And here's your answer:
Open: \app\code\core\Mage\Catalog\Block\Product\View\Options\Type\Select.php
Alter the following lines:
if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DROP_DOWN) {
$select->setName('options['.$_option->getid().']')
->addOption('', $this->__('-- Please Select --'));
}
To:
if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DROP_DOWN) {
$select->setName('options['.$_option->getid().']');
// ->addOption('', $this->__('-- Please Select --'))
}
Summary of changes: I commented out the ->addOption line with two forward slashes AND - and this is important - I moved the semi-colon from the end of that line to the end of the previous line. Reversing this change allows you to undo the changes you made.
When you plug that pup in, you'll see on the frontend your first custom option displaying as the default text.
Here's an example from my website, a product page for my Rugged Notebooks distribution company.

Magento Advance Search - Drop down box of color - Option "All" not coming

I am working on a magento project where advanced search page is already built. I have one attribute called "Color" having following values and also have made attribute property Yes for advance search.
Blue
Green
Yellow.
I also have updated form.php of mage/...so that instead of multiselect, drop down box will come.
Now, in advance search Color drop down, I am not able to set "All" option. I want this because currently Blue is preselected and in each search, this criteria is added. I have not done any updates in other pages.
Please help me.
Jeff
Actually this is a vary useful question and #Jeff's comment is a great solution.
I report it with better formatting:
Comment out this code:
// 2 - avoid yes/no selects to be multiselects
if (is_array($options) && count($options)>2) {
$extra = 'multiple="multiple" size="4"';
$name.= '[]';
}
else {
array_unshift($options, array('value'=>'', 'label'=>Mage::helper('catalogsearch')->__('All')));
}
And replace it with this:
array_unshift($options, array('value'=>'', 'label'=>Mage::helper('catalogsearch')->__('All')));
You can easily create select box for any drop-down attributes like color, manufacturer etc and use for search form or any custom form page.
Here goes the related article:
http://www.blog.magepsycho.com/magento-utility-function-how-to-easily-create-select-box-for-drop-down-attributes
Cheers!!

Resources