unable to edit copied form

Permalink 1 0 Browser Info Environment
I have the same problem as this person had with version 5:
https://www.concrete5.org/developers/bugs/5-5-2-1/clipboard-and-form...

In short: a form that has been copied through the clipboard does not allow to be edited. The blue loading bar goes to 100% and then stalls.


Status: New
burbleweb replied on at Permalink Reply
same here.
wardhache replied on at Permalink Reply
Can confirm. While checking what went wrong in the console, i get this message:
file: "/concrete/src/Block/View/BlockView.php"
line: 120
message: "Call to a member function getAreaCollectionObject() on null"

Looking into the file it occurs, this is the code that is not working properly:
/concrete/src/Block/View/BlockView.php on line 120
$c = $this->area->getAreaCollectionObject();
$arguments = array('/ccm/system/block/action/edit',
    $c->getCollectionID(),
    urlencode($this->area->getAreaHandle()),
    $b->getBlockID(),
    $task,
);

And indeed, for some reason $this->area is null. Due to this issue, you can't get the CollectionObject on line 120, and not even the AreaHandle on line 123.
I have no clue why $this->area is null, but I found a solution to quickly fix this issue.
If you replace the block of code above (from line 120 till 126) with the code underneath, it will be possible to edit your copied form again.
if ($this->area) {
    $c = $this->area->getAreaCollectionObject();
    $arHandle = $this->area->getAreaHandle();
} else {
    $c = $b->getBlockCollectionObject();
    $arHandle = $b->getAreaHandle();
}                    
$arguments = array('/ccm/system/block/action/edit',
    $c->getCollectionID(),
    urlencode($arHandle),
    $b->getBlockID(),
    $task,
);

I wrote it with an if-else because I do think this issue must be resolved deeper and I wanted to keep some of the original code. You also just can replace the $this->area->function() with the $b->function() equivalent.

I hope this is a bit helpful!

concrete5 Environment Information

# concrete5 Version
Core Version - 8.1.0
Version Installed - 8.1.0
Database Version - 20170123000000

# concrete5 Packages
Academy (1.3.2.1), Deluxe Customizable Twitter Feed (0.9.9)

# concrete5 Overrides
blocks/page_list/templates/aca_pagelist4_nolink/view.php, blocks/page_list/templates/aca_pagelist4_nolink, blocks/page_list/templates/aca_pagelist4_link/view.php, blocks/page_list/templates/aca_pagelist4_link, blocks/page_list/templates, blocks/page_list, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, blocks/page_list/templates/aca_pagelist4_nolink/view.php, blocks/page_list/templates/aca_pagelist4_nolink, blocks/page_list/templates/aca_pagelist4_link/view.php, blocks/page_list/templates/aca_pagelist4_link, blocks/page_list/templates, blocks/page_list, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT

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

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
5.5.9-1ubuntu4.21

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gd, geoip, gettext, hash, iconv, imagick, imap, ionCube Loader, json, libxml, mbstring, mcrypt, memcache, memcached, mhash, mysql, mysqli, odbc, openssl, pcntl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, posix, readline, redis, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 60
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
sql.safe_mode - Off
upload_max_filesize - 10M
memcache.max_failover_attempts - 20
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0