php-cuong / magento2-faqs-extensions

Magento 2 FAQ Extension Free
83 stars 56 forks source link

magento2 ver 2.1.3 click add new faq button in the backend, shows many errors #2

Closed oppssssss closed 7 years ago

oppssssss commented 7 years ago

image

rizwan4317 commented 7 years ago

to add category and FAQ form is not showing in magento 2.1.3 see the screenshot

mironsoft75 commented 7 years ago

This does not work in 2.1.3. No form is displayed when editing or re-creating categories or FAQs

php-cuong commented 7 years ago

You should download all the source code with the latest version to your computer

mironsoft75 commented 7 years ago

I have last version (master) installed. That did not help. The form is not displayed. In the log is: [2017-03-08 22:22:34] main.CRITICAL: Warning: htmlspecialchars () expects parameter 1 to be string, array given in ..... vendor / magento / framework / Data / Form / Element / AbstractElement.php on line 286 [] []

bild

ramanvirtuos commented 7 years ago

Is anyone resolve the issue with Magento 2.1.3

We are not able to view the FAQ ADD/EDIT form. Kindly fix this or send me updated branch access

mironsoft75 commented 7 years ago

Please, too. This does not work with versions 2.1.3 / 2.1.4 / 2.1.5. Under 2.1.3 I have not tested.

ramanvirtuos commented 7 years ago

@php-cuong kindly resolve the issue with Version 2.1.3 or upper.

mironsoft75 commented 7 years ago

I have mean, I have not tested with version 2.1.2. Otherwise you see the picture above, I use version 2.1.3 and it is blank page displayed. I do not install with the composer. Can it be that in the ZIP not all files are

ramanvirtuos commented 7 years ago

@mironsoft75 @php-cuong it's not working with composer . I am getting same error

Exception #0 (Exception): Warning: htmlspecialchars() expects parameter 1 to be string, array given

ramanvirtuos commented 7 years ago

issue resolved. I am able to get Add/Edit form on Magento 2.1.x

Aditi321 commented 7 years ago

@ramanvirtuos how did u resolved the issue

Aditi321 commented 7 years ago

we are facing the same issue in magento 2.0.13

ramanvirtuos commented 7 years ago

Hi,

You have to update the PHPCuong\Faq\Block\Adminhtml\Faq\Edit\Tab\Websites.php

Function Name: _prepareForm

Comment this function and replace with following Code:

/**

Aditi321 commented 7 years ago

Exception #0 (Exception): Warning: htmlspecialchars() expects parameter 1 to be string, array given

we are getting above error while adding faq category and faq in magento 2.0.13

Aditi321 commented 7 years ago

error is not resolved after Comment this function and replace with following Code:

/**

$data = $formData->getData(); $data['store_id'] = $formData->getStores(); $form->setValues($data);

$this->setForm($form);

// $this->setForm($form);

return parent::_prepareForm();

}

Aditi321 commented 7 years ago

we are facing the same issue while adding categories in FAQ in magento 2.0.13

nilarocks commented 7 years ago

I have changed $formData->setStores($this->_storeManager->getStore(true)->getId()); instead of $formData->setStoreId($this->_storeManager->getStore(true)->getId());

and working fine. Add/edit screen working fine

sbakker12 commented 7 years ago

`<?php

/*

namespace PHPCuong\Faq\Block\Adminhtml\Faqcat\Edit\Tab;

use Magento\Store\Model\Store;

class Websites extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { /**

sbakker12 commented 7 years ago

`<?php

/*

namespace PHPCuong\Faq\Block\Adminhtml\Faq\Edit\Tab;

use Magento\Store\Model\Store;

class Websites extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { /**

sbakker12 commented 7 years ago

Above code works with 2.16 :)

kevingreek commented 7 years ago

i have correct edit-add form at 2.1.6 CE but only for Faq, not for Categories!! Any idea?

govereem commented 7 years ago

You need to change 2 files /app/code/PHPCuong/Faq/Block/Adminhtml/Faqcat/Edit/Tab/Websites.php /app/code/PHPCuong/Faq/Block/Adminhtml/Faq/Edit/Tab/Websites.php

/Faqcat/Edit/Tab/Websites.php change on row 139 $formData->setSelectStores($this->_storeManager->getStore(true)->getId()); TO $formData->setStores($this->_storeManager->getStore(true)->getId());

/Faq/Edit/Tab/Websites.php change on row 139 $formData->setSelectStores($this->_storeManager->getStore(true)->getId()); TO $formData->setStores($this->_storeManager->getStore(true)->getId());

Tested it on 2.17 CE

sneha-panchal commented 7 years ago

Please update these 2 files :

app\code\PHPCuong\Faq\Block\Adminhtml\Faq\Edit\Tab\Websites.php

`<?php

/*

namespace PHPCuong\Faq\Block\Adminhtml\Faq\Edit\Tab;

use Magento\Store\Model\Store;

class Websites extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { /**

app\code\PHPCuong\Faq\Block\Adminhtml\Faqcat\Edit\Tab\Websites.php

`<?php

/*

namespace PHPCuong\Faq\Block\Adminhtml\Faqcat\Edit\Tab;

use Magento\Store\Model\Store;

class Websites extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { /**

Above code is tested and also working in magento CE 2.1.x.

Thanks..

php-cuong commented 7 years ago

The problem was fixed, please pull the latest codes.