Hi, great module but I'm getting this error when I add and then remove a paragraph.

Notice: Undefined index: _weight in _field_sort_items_helper() (line 537 of /home/MYSITE/public_html/tests/modules/field/field.module).

Warning: uasort() [function.uasort]: Array was modified by the user comparison function in paragraphs_remove_submit() (line 1526 of /home/MYSITE/public_html/tests/sites/all/modules/paragraphs/paragraphs.module).

Using Drupal 7.24 and Paragraph 7.x-1.0-alpha6

Any ideas as to why I'm getting this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jeroen.b’s picture

I can't reproduce this...
What PHP version are you using?
Are you using any other modules that might alter the weight/sort table?

jeroen.b’s picture

Priority: Major » Minor
Status: Active » Postponed (maintainer needs more info)
Babymaggie’s picture

Hi, Jeroen

I'm Using PHP 5.3.24

Looking through my list of modules I can't see any that would alter the weight/sort table.

Babymaggie’s picture

I have changed to PHP 5.5.5, Cleared caches, ran update scripts etc but the error still remains. Other modules are now showing errors so I will have to revert back for now.

jeroen.b’s picture

Hmm odd... Well, some more questions then...
What version of Entity? What theme/admin theme are you using?

Babymaggie’s picture

I'm using Admin theme: Seven 7.24
Using site default theme: Simpler 7.x-1.0-beta2.
Tried both: 7.x-1.2 and 7.x-1.x-dev of Entity, neither versions fixed the fault though.

markomat’s picture

Got the same notice messages when I ran Paragraphs (alpha6) on http://simplytest.me today

Status report says:
Drupal 7.25-dev
Entity API 7.x-1.2
(no other contrib module active)

PHP 5.3.10-1ubuntu3.5

xumepadismal’s picture

Version: 7.x-1.0-alpha6 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Needs review
FileSize
1.61 KB

Same issue. I've figured out that it's because of 'add_more' button's value passes into $input array. It doesn't have '_weight' property of course and it breaks the '_field_sort_items_helper' function.

I guess that we can just remove it from $input because this button even not pressed, am I right? Patch attached.

jeroen.b’s picture

Thanks! Patch pushed in alpha9, please test!

Babymaggie’s picture

Just tried the updated module and this has done the trick.

I have completely redone the main part of my site to incorporate paragraphs now.

This has bought a massive change to usability of the site and to the end users enjoyment.

Many thanks to xumepadismal, jeroen.b, markomat and all who helped solve and work on the solution to this problem.

Lovely module :)

jeroen.b’s picture

Status: Needs review » Closed (fixed)