No Functionality when creating blocks in a Package

Permalink Browser Info Environment
When trying to "concrete/bin/concrete c5:block-developer -b testblock" on a v9.0.1 Project with BlockDeveloper 1.2.3 it only works if i dont place the block in a package.

If i choose to place the block in an existing package the script runs fine, all lights green but there is no block (and no entry in the "BlockTypes" Table)

Any ideas or ways for me to figure out what is failing?

Regards

Type: Pre-Sale
Status: Resolved
donat
View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

Is the directory created in that package? If not, did you set the correct read/write rights for this directory?

If it is created, can you see if all files that are necessary are there?

Kind regards
Ramon
donat replied on at Permalink Reply
donat
Thanks for responding.

The Folder is created in the package with all files at /packages/mypackage/blocks/theblock.
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there again,

Just tried it out, and I am seeing the same. Seems like they changed something crucial the way 9.x works - as the classes for Block Developer seem not to be loaded when the block is loaded. So this is a core concreteCMS issue at the moment, since it works perfectly fine in the /application/blocks directory. You can continue installing the block types in the /application folder at this point though.

At the moment, I don't see a workaround or fix yet. I will try my best for you though. I already posted an issue in the Slack channels, hoping to get an answer. Let's wait that out and see what happens.

Kind regards
Ramon
ramonleenders replied on at Permalink Reply
ramonleenders
I've got a temporary fix in 1.2.4 - it needs some manual changes though.

1) Install/create the block as you normally do in the CLI
2) Locate the controller.php file of the block
3) Change the line "use Devoda\BlockDeveloper\BlockDeveloper\Block\BlockController;" to "use Concrete\Core\Block\BlockController;"
4) Run the same CLI command as in step 1
5) The block type should be installed now, revert the change from step 3
6) You're done.

Not ideal for sure, but it's a workaround until they come up with a fix for this issue (probably not loading stuff in the correct order).

You do need version 1.2.4 of Block Developer, because I made sure some steps didn't fail because when using the default BlockController, a few methods are not available which the code expected to be there before. Now they may not be present and it will just say "failed" in the CLI but that's fine since it was already done in the initial creation.

Let me know if this works for you now. Sorry I couldn't come up with anything easier for now.

Kind regards
Ramon
Lemonbrain replied on at Permalink Reply
Lemonbrain
Thanks a lot.

I did the following:

1) create the Block in the CLI with -s install
2) taylor config.php
3) rerun cli with -s install (so db is updated and all)
4) change the "use" line in the controller
5) rerun without skipping installation
6) change the controller back to normal

This gives me an installed block inside the package with following Problems:
- the "default_set" option in config.php -> 'block' is not respected
- inside a repeatable, the image fieldtype is not working. the form is there but the fileselector does not get initialized i guess. outside a repeatable, it works.
NOTE: i have also tested an image fieldtype on a block installed outside a package. there i got similar problems and had to change the controller to get it to install and the image inside a repeatable also did not work

block_developer is 1.2.4 and concrete is 9.0.1

Seasonal Greetings
donat from lemonbrain
ramonleenders replied on at Permalink Reply
ramonleenders
Hi Donat,

The Block Type Set issue is also related to version 9 unfortunately. Perhaps I can also find a workaround for that... Still waiting for someone to reply on my question regarding these things.

As for the "Image" not working in repeatables, images/selectors work differently in version 9 as well. It indeed should work perfectly fine without a repeatable, but with repeatables it's an issue for now. This is the new setup of version 9 and should be something I can sort out but this takes a bit more effort so I won't be able to be of help on the short-short term. Hope to get this issue resolved ASAP. Due to holidays and deadlines this is something I haven't had time to fix yet.

Happy holidays and hope you manage for now!

Kind regards
Ramon
ramonleenders replied on at Permalink Reply
ramonleenders
Hi Donat,

I just tested the following issues in 9.0.2 of ConcreteCMS:

- the "default_set" option in config.php -> 'block' is not respected
- inside a repeatable, the image fieldtype is not working. the form is there but the fileselector does not get initialized i guess. outside a repeatable, it works.

Both are working good now. For the last bug, please update to 1.3.0. The first bug seems related to ConcreteCMS 9.0.1 (or below) - as it appears to be working perfectly here in 9.0.2.

Let me know if you still have any issues!

Kind regards
Ramon

concrete5 Environment Information

# Concrete Version
Core Version - 9.0.1
Version Installed - 9.0.1
Database Version - 20211104161958

# Database Information
Version: 8.0.27-0ubuntu0.20.04.1
SQL Mode: STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_ENGINE_SUBSTITUTION

# Concrete Packages
Block Developer (1.2.3), KBS Glarus (0.1.0), Lemonbrain Services (3.0.6), Lemonbrain Webp (1.0.11)

# Concrete Overrides
None

# Concrete Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache/2.4.41 (Ubuntu)

# Server API
apache2handler

# PHP Version
7.4.3

# PHP Extensions
apache2handler, bz2, calendar, Core, ctype, curl, date, dom, exif, FFI, fileinfo, filter, ftp, gd, gettext, hash, iconv, intl, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets, sodium, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xdebug, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
upload_max_filesize - 20M
mbstring.regex_retry_limit - 1000000
mbstring.regex_stack_limit - 100000
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
unserialize_max_depth - 4096
xdebug.max_nesting_level - 256
xdebug.max_stack_frames - -1
xdebug.var_display_max_children - 128
xdebug.var_display_max_data - 512
xdebug.var_display_max_depth - 3
opcache.max_accelerated_files - 10000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.