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

Improvements Compilation #574

Open
theshreyas opened this issue Apr 2, 2024 · 0 comments
Open

Improvements Compilation #574

theshreyas opened this issue Apr 2, 2024 · 0 comments

Comments

@theshreyas
Copy link

theshreyas commented Apr 2, 2024

1. Cannot Allow Fulltext Search on integer columns

SQLSTATE[HY000]: General error: 1283 Column 'entity_id' cannot be part of FULLTEXT index, query was: CREATE TABLE `vendorname_test_blog` (
`entity_id` int UNSIGNED NOT NULL  AUTO_INCREMENT COMMENT "entity_id", 
CONSTRAINT  PRIMARY KEY (`entity_id`), 
FULLTEXT INDEX `VENDORNAME_TEST_BLOG_ENTITY_ID` (`entity_id`)
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci COMMENT="BLOGs"

StepsToReproduce : select any integer field as model column, enable admingrid and search checkbox.
Solution : Disable search checkbox when integer field is present in model column and vice versa

2. Declaration of Magento\Framework\Api\SearchResults::getItems() must be compatible with Vendorname\CustomModule\Api\Data\BlogSearchResultsInterface::getItems(): array in /var/www/html/m3/vendor/magento/framework/Api/SearchResults.php on line 26

StepsToReproduce : select model with 3-4 field/columns.
Solution : Remove strict return type from Api/Data/ModelSearchResultsInterface.php file (array & static)
old
public function getItems(): array;
public function setItems(array $items): static;
new
public function getItems();
public function setItems(array $items);

3. Class "Vendorname\CustomModule\Controller\Adminhtml\Blog\ModelFactory" does not exist. Class Vendorname\CustomModule\Controller\Adminhtml\Blog\Delete\Interceptor generation error: The requested class did not generate properly,

StepsToReproduce : select model with 3-4 field/columns.
Solution : In the file Vendorname/Module/Controller/Adminhtml/Modelname/Delete.php, on line 8,
change this line from
use Vendorname\Module\Model\ModelnameFactory;
to
use Vendorname\Module\Model\ModelnameFactory as ModelFactory;

4. In backend, admin grid is not present. Add routes.xml, menu.xml
5. run phpcs & phpcbf on generated module and incorporate changes, e.g. adding php docblocks, etc.

I will add more to this as I remember. and Awesome module!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant